Esempio n. 1
0
        public async Task <IActionResult> Create([FromBody] CreateUserRequest user)
        {
            var result = await _usersBusinessLogic.CreateUserAccount(user);

            if (result.Succeeded)
            {
                return(this.OkResult());
            }
            else
            {
                if (result.Errors.Select(x => x.Code == ErrorCode.DuplicateEmail.ToString()).Any())
                {
                    return(this.ExceptionResult(ErrorCode.DuplicateEmail));
                }
                else
                {
                    return(this.ExceptionResult(ErrorCode.INVALID_DATA));
                }
            }
        }