init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
26
Framework/Caching/ManualEnumCache.cs
Normal file
26
Framework/Caching/ManualEnumCache.cs
Normal file
|
@ -0,0 +1,26 @@
|
|||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Kreta.Framework.Caching
|
||||
{
|
||||
internal sealed class ManualEnumCache : Cache
|
||||
{
|
||||
private ConcurrentDictionary<string, Dictionary<string, string>> cache;
|
||||
|
||||
public ManualEnumCache(CacheManager cacheManager) : base(cacheManager)
|
||||
{
|
||||
cache = new ConcurrentDictionary<string, Dictionary<string, string>>();
|
||||
}
|
||||
|
||||
public Dictionary<string, string> GetOrAdd(string key, Func<string, Dictionary<string, string>> valueFactory)
|
||||
{
|
||||
return cache.GetOrAdd(key, valueFactory);
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
cache.Clear();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue