示例#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 T Get <T>(string Id)
        {
            var st = _RepositoryManagement.Get <T>(Id);

            return(st);
        }