public bool Update(T entity) { ctx.Entry(entity).State = EntityState.Modified; int result = ctx.SaveChanges(); if (result > 0) { return(true); } return(false); }
public bool AddProductBool(Product product) { UdemyETicaretDBContext ctx = new UdemyETicaretDBContext(); EntityState result = ctx.Entry(product).State = EntityState.Added; if (result != 0) { return(true); } else { return(false); } }