예제 #1
0
        private async Task CreateCart(string username)
        {
            var user = await userManager.FindByNameAsync(username);

            Cart cart = new Cart()
            {
                UserId = user.Id
            };
            var createdCart = await cartRepo.Create(cart);

            if (createdCart != null)
            {
                user.CartId = createdCart.Id;
                await userManager.UpdateAsync(user);
            }
        }