コード例 #1
0
        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());
        }
コード例 #2
0
        // *******************************************************************************************************************************
        #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));
        }
コード例 #3
0
        public async Task <Result <int> > CreateAsync([FromBody] CreateAdminUserCommand command, CancellationToken cancellationToken)
        {
            var(subCode, res) = await bus.SendCommand(command, cancellationToken);

            return(Success(subCode, res));
        }
コード例 #4
0
 public Task <string> CreateUserAsync(CreateAdminUserCommand cmd)
 {
     return(base.RequestAsync(cmd));
 }