public static void AddCustomer(Customer customer) { using (context=new NORTHWNDEntities()) { context.Customers.Add(customer); context.SaveChanges(); } }
public static void ModifyCustomer(Expression<Func<Customer, bool>> exp, Customer newData) { using (context=new NORTHWNDEntities()) { var customer = context.Customers.First(exp); customer = newData; context.SaveChanges(); } }