public void Save(Employee employee)
 {
     using (var context = new AutomaxContext())
     {
         context.Employees.AddOrUpdate(employee);
         context.SaveChanges();
     }
 }
 public void Save(Invoice invoice)
 {
     using (var context = new AutomaxContext())
     {
         context.Employees.Attach(invoice.Employee);
         context.Invoices.AddOrUpdate(invoice);
         context.SaveChanges();
     }
 }