public async Task <ActionResult <AspNetRolesReadModel> > Add([FromBody] AspNetUsersCreateModel createModel, CancellationToken cancellationToken) { var user = new NesopsUser { UserName = createModel.UserName }; var userRoles = new List <string>() { "ActiveUser" }; var result = await _authorizeService.CreateUserAsync(user, createModel.Password, userRoles); if (result.Succeeded) { return(Ok(new BaseResponseModel <object> { message = "Create User Successful", code = 200 })); } var responseModel = new BaseResponseModel <object> { message = "Create User Fail", code = 400 }; foreach (var err in result.Errors) { responseModel.SetError(err.Code, err.Description); } return(BadRequest(responseModel)); }