コード例 #1
0
 public void Save(Employee employee)
 {
     using (var context = new AutomaxContext())
     {
         context.Employees.AddOrUpdate(employee);
         context.SaveChanges();
     }
 }
コード例 #2
0
 public void Save(Invoice invoice)
 {
     using (var context = new AutomaxContext())
     {
         context.Employees.Attach(invoice.Employee);
         context.Invoices.AddOrUpdate(invoice);
         context.SaveChanges();
     }
 }