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