Esempio n. 1
0
        public IHttpActionResult Get(int id)
        {
            var product = CacheManagement.GetListProducts().SingleOrDefault(i => i.Id == id);

            if (product.IsNull())
            {
                return(NotFound());
            }
            return(Ok(product));
        }
 public IHttpActionResult Delete(int id)
 {
     if (CacheManagement.GetListProducts().Where(pd => pd.CategoryID == id).Count() > 0)
     {
         return(Json(new { error = true, errormessage = MessageContant.Recordisused }));
     }
     if (_iProductCategoriesBusiness.Delete(id))
     {
         CacheManagement.RemoveProducts();
         return(Ok(1));
     }
     return(NotFound());
 }
Esempio n. 3
0
 public List <Products> Get()
 {
     return(CacheManagement.GetListProducts());
 }