public IActionResult AddShopCard(ShoppingCardVM shoppingBox) { var entity = new ShoppingBox(); entity.BookId = shoppingBox.BookId; entity.Price = shoppingBox.Price; entity.Quantity = shoppingBox.Quantity; entity.UserId = shoppingBox.UserId; entity.Title = shoppingBox.Title; _shoppingBoxService.Add(entity); return(Ok()); }
public void Add(ShoppingBox shoppingBox) { _context.ShoppingBox.Add(shoppingBox); _context.SaveChanges(); }