public async Task <string> Create(ApplicationUserWriteDto model) { var user = _mapper.Map <ApplicationUser>(model); var result = await _userManager.CreateAsync(user, model.Password); if (!result.Succeeded) { throw new BadRequestException(result.Errors.Any() ? result.Errors.ElementAt(0) : null); } await _userManager.AddToRoleAsync(user.Id, model.RoleName); return(user.Id); }
public async Task <IHttpActionResult> Post([FromBody] ApplicationUserWriteDto model) { var id = await _accountsFcd.Create(model); return(Ok()); }