public async Task <AppRegistResult> RegistAsync(SignUpModel signUpModel) { var appUser = mapper.Map <AppUser>(signUpModel); var result = await identityUnitOfWork.UserManager.CreateAsync(appUser, signUpModel.Password); if (!result.Succeeded) { return(new AppRegistResult(result)); } var user = mapper.Map <UserModel>(signUpModel); user.Id = appUser.Id; await userCrudService.CreateAsync(user); return(new AppRegistResult()); }
public async Task <IActionResult> Create([FromBody] User user) { await _userCrudService.CreateAsync(user); return(Ok()); }