public static (Category, bool) CategoryCUD(Category category, EntityState entityState) { using (CariHesapDbEntities c = new CariHesapDbEntities()) { c.Entry(category).State = entityState; if (c.SaveChanges() > 0) { return(category, true); } else { return(category, false); } } }
public static (User, bool) UserCUD(User user, EntityState entityState) { using (CariHesapDbEntities c = new CariHesapDbEntities()) { c.Entry(user).State = entityState; if (c.SaveChanges() > 0) { return(user, true); } else { return(user, false); } } }
public static (Product, bool) ProductCUD(Product product, EntityState entityState) { using (CariHesapDbEntities c = new CariHesapDbEntities()) { c.Entry(product).State = entityState; if (c.SaveChanges() > 0) { return(product, true); } else { return(product, false); } } }