private static void Crud() { var service = new SimpleDataServices(); var customer = new Customer { FirstName = "Ian", LastName = "Russell", Email = "*****@*****.**" }; customer = service.Insert(customer); ObjectDumper.Write(customer); customer.Country = "United Kingdom"; service.Update(customer); customer = service.Get(customer.CustomerId); ObjectDumper.Write(customer); service.Delete(customer); customer = service.Get(customer.CustomerId); ObjectDumper.Write(customer); }
public Customer Insert(Customer customer) { return (Customer)db.Customer.Insert(customer); }
public void Update(Customer customer) { db.Customer.UpdateByCustomerId(customer); }
public void Delete(Customer customer) { db.Customer.DeleteByCustomerId(customer.CustomerId); }