Esempio n. 1
0
 public async Task CreateOrder(Order order)
 {
     _context.Orders.Add(order);
     await _context.SaveChangesAsync();
 }
Esempio n. 2
0
 public async Task CreateProduct(Product product)
 {
     _context.Product.Add(product);
     await _context.SaveChangesAsync();
 }
Esempio n. 3
0
 /// <summary>
 /// Creates a new Basket Object when user adds something to their cart
 /// </summary>
 /// <param name="basket">The instance of Basket to be created</param>
 /// <returns>Nothing, creates new basket into database table</returns>
 public async Task CreateBasket(Basket basket)
 {
     _context.Basket.Add(basket);
     await _context.SaveChangesAsync();
 }