示例#1
0
 public bool TryGetValue(string profileId, string assetType, out ClientProfileSettingsContract result)
 {
     _lockSlim.EnterReadLock();
     try
     {
         return(_cache.TryGetValue(GetKey(profileId, assetType), out result));
     }
     finally
     {
         _lockSlim.ExitReadLock();
     }
 }
示例#2
0
 public void AddOrUpdate(ClientProfileSettingsContract clientProfileSettings)
 {
     _lockSlim.EnterWriteLock();
     try
     {
         _cache[GetKey(clientProfileSettings)] = clientProfileSettings;
     }
     finally
     {
         _lockSlim.ExitWriteLock();
     }
 }
示例#3
0
 public void Remove(ClientProfileSettingsContract clientProfileSettings)
 {
     _lockSlim.EnterWriteLock();
     try
     {
         _cache.Remove(GetKey(clientProfileSettings));
     }
     finally
     {
         _lockSlim.ExitWriteLock();
     }
 }
示例#4
0
 private string GetKey(ClientProfileSettingsContract clientProfileSettings)
 {
     return(GetKey(clientProfileSettings.ClientProfileId, clientProfileSettings.AssetTypeId));
 }