public async Task <IActionResult> IndexAsync() { var res = await adminUserAppService.GetListAsync(10, "", CancellationToken.None); var user = new CreateAdminUserCommand() { }; var vaild = user.IsVaild(); var errors = user.GetErrors(); var createRes = await adminUserAppService.CreateAsync(user, CancellationToken.None); return(View()); }
// ******************************************************************************************************************************* #region - AdminUser - public async Task <string> CreateAdminUserAsync(CreateAdminUserCommand cmd) { var msgCode = CheckUserDTO(cmd.User); if (!msgCode.IsSuccess()) { return(msgCode); } // ^^^^^^^^^^ // TODO: call passport account api var user = await UserDAL.GetUserAsync(cmd.User.ID).ConfigureAwait(false); if (user.IsNotNull()) { return("User already exists."); } return(await UserDAL.InsertUserAsync(cmd.User).ConfigureAwait(false)); }
public async Task <Result <int> > CreateAsync([FromBody] CreateAdminUserCommand command, CancellationToken cancellationToken) { var(subCode, res) = await bus.SendCommand(command, cancellationToken); return(Success(subCode, res)); }
public Task <string> CreateUserAsync(CreateAdminUserCommand cmd) { return(base.RequestAsync(cmd)); }