Пример #1
0
        public async Task <IActionResult> Register([FromBody] AthenticationUserCommand command)
        {
            try
            {
                var user   = UserAdapter.CommandToDomain(command, command.Context);
                var result = await _userManager.CreateAsync(user, user.PasswordHash);

                if (result.Succeeded)
                {
                    return(Created("GetUser", command));
                }
                return(BadRequest(result.Errors));
            }
            catch (Exception ex)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
            }
        }