Пример #1
0
        public IActionResult Details(string id)
        {
            Product product;

            var obj = cache.StringGet(id);

            if (obj.HasValue == true)
            {
                product = JsonConvert.DeserializeObject <Product>(obj);
            }
            else
            {
                product         = _repositoryManagement.Get <Product>(id);
                product.counter = product.counter + 1;
                _repositoryManagement.UpdateInfo <Product>(id, product);
            }

            return(Ok(product));
        }
Пример #2
0
 public void UpdateInfo <T>(string Id, T record)
 {
     _RepositoryManagement.UpdateInfo <T>(Id, record);
 }