public async Task <ActionResult <Order> > CreateOrder([Bind("Id, UserId, Items, Total")] Order order) { if (ModelState.IsValid) { _context.Add(order); await _context.SaveChangesAsync(); } return(order); }
public async Task <ActionResult <Product> > CreateProduct([Bind("Id,Title,Description,Price")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); } return(product); }