Esempio n. 1
0
 //Create
 public Order Insert(Order order)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         ctx.Order.Add(order);
         ctx.SaveChanges();
         return this;
     }
 }
Esempio n. 2
0
 //Update
 public Order Update(Order order)
 {
     using (OrderTrackEntities ctx = new OrderTrackEntities())
     {
         Order Order = ctx.Order.First(x => x.OrderID == this.OrderID);
         Order = order;
         ctx.SaveChanges();
         return Order;
     }
 }
 public Order Put(Order order)
 {
     return new Order().Insert(order);
 }
 public Order Post(Order order)
 {
     return new Order().Update(order);
 }