예제 #1
0
 public void Products(OrderItem orderitem)
 {
     using (var db = new OrderItemContext()) {
         db.Entry(orderitem).State = EntityState.Added;
         db.SaveChanges();
     }
 }
예제 #2
0
 public void PutProduct(string id, OrderItem orderitem)
 {
     orderitem.Id = id;
     using (var db = new OrderItemContext()){
         var order = db.OrderItems.SingleOrDefault(o => o.Id == id);
         db.Remove(order);
         db.Add(orderitem);
         db.SaveChanges();
     }
 }
예제 #3
0
 public int?Add(OrderItem entity)
 {
     _orderItemContext.OrderItems.Add(entity);
     _orderItemContext.SaveChanges();
     return(entity.ID);
 }