예제 #1
0
파일: Program.cs 프로젝트: ciker/MicroORM
        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);
        }
예제 #2
0
 public Customer Insert(Customer customer)
 {
     return (Customer)db.Customer.Insert(customer);
 }
예제 #3
0
 public void Update(Customer customer)
 {
     db.Customer.UpdateByCustomerId(customer);
 }
예제 #4
0
 public void Delete(Customer customer)
 {
     db.Customer.DeleteByCustomerId(customer.CustomerId);
 }