Inheritance: MicroServices.Common.ReadObject
Exemplo n.º 1
0
        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");
                }
            }
        }
Exemplo n.º 2
0
 public void UpdateLocalCache(ProductDto newValue)
 {
     throw new NotImplementedException();
 }