public CartResponse CreateCart() { CartResponse resp = new CartResponse(); Entities.Cart c = DS.Cart.Cart.CreateCart(); resp.CartID = c.CartID; resp.CreateDate = c.CreateDate; resp.ModifyDate = c.ModifyDate; resp.Total = resp.CartItems.Sum(i => i.Price); return resp; }
public CartResponse RemoveProduct(CartProductRequest request) { CartResponse resp = new CartResponse(); Entities.Cart c = DS.Cart.Cart.RemoveProduct(request.CartID, request.ProductID); resp.CartID = c.CartID; resp.CreateDate = c.CreateDate; resp.ModifyDate = c.ModifyDate; resp.CartItems = GetProducts(c.ProductIDs); resp.Total = resp.CartItems.Sum(i => i.Price); return resp; }