コード例 #1
0
        public async Task <AccountDto?> CreateNewAccountAsync(string profileId)
        {
            if (!string.IsNullOrEmpty(profileId))
            {
                var accountRequest = new AccountDto {
                    ProfileId = profileId
                };
                accountRequest.SetPending();

                var newAccount = await _accountsService.CreateAccountAsync(accountRequest.ToAccountEntity());

                await _publishEndpoint.Publish(newAccount?.ToAccountEvent <AccountCreatedEvent>());

                await _publishEndpoint.Publish(newAccount?.ToAccountEvent <AccountCheckCommand>());

                return(newAccount?.ToAccountModel <AccountDto>());
            }

            return(null);
        }