public static void DeleteCustomer(Customer input) { using (var db = new NorthwindEntities()) { db.Customers.Remove(input); db.SaveChanges(); } }
public static void AddCustomer(Customer input) { using (var db = new NorthwindEntities()) { db.Customers.Add(input); db.SaveChanges(); } }
public static void ModifyCustomer(Customer input) { using (var db = new NorthwindEntities()) { db.Customers.Attach(input); db.Entry(input).State = EntityState.Modified; db.SaveChanges(); } }