コード例 #1
0
        public async Task <ShoppingCart> AddToCart(ShoppingCart shoppingCart)
        {
            if (!_shoppingCartValidator.IsShoppingCartValid(shoppingCart))
            {
                throw new Exception("Shopping Cart already contains same configuration Laptop, please add different configuration" + shoppingCart);
            }

            return(await _shoppingCartRepository.AddToCart(shoppingCart));
        }