// method for updating a product public int Product_Update(Product prod) { using (var context = new HTPSContext()) { context.Entry(prod).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges()); } }
public int Product_Delete(Product prod) { using (var context = new HTPSContext()) { prod.Discontinued = true; prod.DiscontinuedDate = DateTime.Today; context.Entry(prod).State = System.Data.Entity.EntityState.Modified; return(context.SaveChanges()); } }