コード例 #1
0
 public static void AddCustomer(Customer customer)
 {
     using (context=new NORTHWNDEntities())
     {
         context.Customers.Add(customer);
         context.SaveChanges();
     }
 }
コード例 #2
0
 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();
     }
 }