public async Task<IdentityResult> RegisterUser(UserModel userModel) { var user = new ApplicationUser { UserName = userModel.Email.ToLower(), Email = userModel.Email }; var result = await UserManager.CreateAsync(user, userModel.Password); return result; }
public async Task<IHttpActionResult> Register(UserModel userModel) { if (userModel == null || !ModelState.IsValid) { return BadRequest(ModelState); } var result = await _authRepository.RegisterUser(userModel); var errorResult = GetErrorResult(result); if (errorResult != null) { return errorResult; } return Ok(); }