Example #1
0
        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());
        }
Example #2
0
 public void  Add(ShoppingBox shoppingBox)
 {
     _context.ShoppingBox.Add(shoppingBox);
     _context.SaveChanges();
 }