Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. using (ShopDbContext shopDbContext = new ShopDbContext())
  2. {
  3. var orderEntry = new OrderEntryModel();
  4. orderEntry.OrderRefId = cart.Id;
  5. orderEntry.Product = shopDbContext.Products.First(product => product.Code.Equals(productCode));
  6. orderEntry.Quantity = quantity;
  7.  
  8. shopDbContext.OrderEntries.Add(orderEntry);
  9. shopDbContext.SaveChanges();
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement