| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using Abp.Dependency;
- using Abp.Runtime.Caching.Configuration;
- using Castle.Core.Logging;
- namespace Abp.Runtime.Caching.Memory
- {
- /// <summary>
- /// Implements <see cref="ICacheManager"/> to work with MemoryCache.
- /// </summary>
- public class AbpMemoryCacheManager : CacheManagerBase
- {
- public ILogger Logger { get; set; }
- /// <summary>
- /// Constructor.
- /// </summary>
- public AbpMemoryCacheManager(IIocManager iocManager, ICachingConfiguration configuration)
- : base(iocManager, configuration)
- {
- Logger = NullLogger.Instance;
- }
- protected override ICache CreateCacheImplementation(string name)
- {
- return new AbpMemoryCache(name)
- {
- Logger = Logger
- };
- }
- protected override void DisposeCaches()
- {
- foreach (var cache in Caches.Values)
- {
- cache.Dispose();
- }
- }
- }
- }
|