public async Task <IActionResult> Create([FromBody] CreateUserViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            IdentityResult result = await _applicationUserService.CreateUserAsync(model);

            if (!result.Succeeded)
            {
                return(BadRequest("Failed"));
            }

            return(Ok(201));
        }
Beispiel #2
0
        public async Task <ActionResult <UserDto> > CreateUserAsync(UserDto userDto)
        {
            var user = await applicationUserService.CreateUserAsync(userDto.Email, userDto.Password, userDto.Name, userDto.Firstname, userDto.Lastname, userDto.SocialSecurityNumber);

            return(Ok(user));
        }