// GET: api/Product public List<Product> Get() { ProductFacade facade = new ProductFacade(db); List<Product> AllProducts = facade.GetAll(); return AllProducts; }
public void Post([FromBody]Product product) { ProductFacade facade = new ProductFacade(db); if (facade.Get(product.ID) == null) { facade.Insert(product); } else { facade.Update(product); } }
public List<Product> GetProductsByType(int typeId) { ProductFacade facade = new ProductFacade(db); return facade.GetProductsByType(typeId); }
// GET: api/Product/5 public Product Get(int id) { ProductFacade facade = new ProductFacade(db); return facade.Get(id); }
// DELETE: api/Product/5 public void Delete(int id) { ProductFacade facade = new ProductFacade(db); facade.Delete(id); }