public async Task <GoogleAdto> CreateAsync(CreateGoogleAdto createGoogleAdto)
        {
            using (ITransaction transaction = _transactionManager.Create())
            {
                try
                {
                    AuthenticationGrantTypeGoogle authenticationGrantTypeGoogle =
                        await _createAuthenticationGrantTypeGoogleCommand.ExecuteAsync(
                            _mapper.Map <CreateGoogleAdto, CreateAuthenticationGrantTypeGoogleDdto>(createGoogleAdto));

                    await _commandRepository.AddAsync(authenticationGrantTypeGoogle);

                    transaction.Commit();

                    return(CreateGoogleAdto(authenticationGrantTypeGoogle));
                }
                catch (DomainValidationRuleException e)
                {
                    throw new BusinessValidationRuleApplicationException(e.ValidationResult);
                }
            }
        }
Beispiel #2
0
 public Task <GoogleAdto> CreateAsync(CreateGoogleAdto createGoogleAdto)
 {
     return(_securityApplicationService.SecureAsync(() => _googleAuthenticationServiceApplicationService.CreateAsync(createGoogleAdto),
                                                    DefaultAuthorisationContext.Create(AuthorisationResource.AuthenticationService, AuthorisationAction.Create)));
 }