Beispiel #1
0
        public Result CreateNewCart(UserDto userDto)
        {
            try
            {
                if (userDto?.Email == null)
                {
                    throw new Exception("Validation exception: User doesn't exist");
                }

                CartRepo.CreateNewCart(userDto.Email);

                return(new Result()
                {
                    ResultCode = EnumResultCode.OK
                });
            }
            catch (Exception ex)
            {
                return(new Result()
                {
                    ResultCode = EnumResultCode.Error, Details = ex.Message
                });
            }
        }