













.context.Services.AddEntityCache<Product, Guid>().IEntityCache<Product, Guid>服务使用此用法,实体类应可序列化/可序列化为 JSON/可从 JSON 反序列化。
ProductCacheItemProduct->ProductCacheItem.context.Services.AddEntityCache<Product, ProductCacheItem, Guid>().IEntityCache<ProductCacheItem, Guid>服务只有使用最佳实践指南构建的可重用模块才需要这样做。应用程序开发人员不需要它。
ProductCacheItemProduct->ProductCacheItem.*context.Services.AddEntityCache<TMyModule, Product, ProductCacheItem, Guid>().IEntityCache<ProductCacheItem, Guid>服务context.Services.AddEntityCache()方法都获得一个可选的DistributedCacheEntryOptions,在这里您可以轻松地配置选项。默认值为:new DistributedCacheEntryOptions {
AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(2)
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。