Esempio n. 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();
     }
 }
Esempio n. 2
0
 public void AddOrUpdate(ClientProfileSettingsContract clientProfileSettings)
 {
     _lockSlim.EnterWriteLock();
     try
     {
         _cache[GetKey(clientProfileSettings)] = clientProfileSettings;
     }
     finally
     {
         _lockSlim.ExitWriteLock();
     }
 }
Esempio n. 3
0
 public void Remove(ClientProfileSettingsContract clientProfileSettings)
 {
     _lockSlim.EnterWriteLock();
     try
     {
         _cache.Remove(GetKey(clientProfileSettings));
     }
     finally
     {
         _lockSlim.ExitWriteLock();
     }
 }
Esempio n. 4
0
 private string GetKey(ClientProfileSettingsContract clientProfileSettings)
 {
     return(GetKey(clientProfileSettings.ClientProfileId, clientProfileSettings.AssetTypeId));
 }