public void UpdateLocalCache(ProductDto newValue) { ProductDto retrievedValue; Guid searchKey = newValue.Id; if (products.TryGetValue(searchKey, out retrievedValue)) { if (!products.TryUpdate(searchKey, newValue, retrievedValue)) { throw new ApplicationException("Failed to update the product in the cache"); } } else { if (!products.TryAdd(searchKey, newValue)) { throw new ApplicationException("Failed to add new product to the cache"); } } }
public void UpdateLocalCache(ProductDto newValue) { throw new NotImplementedException(); }