public void DeleteProduct1(int cid) { var rep = new EfProductService(context); var product = rep.GetById(cid); if (product != null) { if (rep.GetAll().Contains(product)) { rep.Delete(product); } } }
public void PostProduct(Product product) { var rep = new EfProductService(context); rep.Save(product); }
public Product GetProduct(int id) { var rep = new EfProductService(context); return(rep.GetById(id)); }