public Entity.Cartproduct ParseCartProducts(Model.CartProducts cartproduct) { return(new Entity.Cartproduct { Id = cartproduct.CPID, IdProd = cartproduct.RecID, IdCart = cartproduct.CartID, ProductQuant = cartproduct.RecQuan }); }
void I_GRDL.PurgeCartProducts(Model.CartProducts cartProductsforDeletion) { _context.ChangeTracker.Clear(); _context.Cartproducts.RemoveRange(_mapper.ParseCartProducts(cartProductsforDeletion)); _context.SaveChanges(); }
void I_GRDL.AddToCartProducts(Model.CartProducts cartProducts) { cartProducts.CPID = RNG.numb.Next(1, 1001); _context.Cartproducts.Add(_mapper.ParseCartProducts(cartProducts)); _context.SaveChanges(); }