public async Task DeleteClientCredentialAsync(DeleteClientCredentialAdto deleteClientCredentialAdto)
        {
            using (ITransaction transaction = _transactionManager.Create())
            {
                try
                {
                    if (!(await _commandRepository.GetWithConcurrencyCheckAsync(deleteClientCredentialAdto.Id, deleteClientCredentialAdto.Version) is AuthenticationGrantTypeClientCredential
                          authenticationGrantTypeClientCredential))
                    {
                        throw new BusinessApplicationException(ExceptionType.NotFound, "Authentication service not found");
                    }

                    await _commandRepository.DeleteAsync(authenticationGrantTypeClientCredential.Id);

                    transaction.Commit();
                }
                catch (ConcurrencyDomainException e)
                {
                    throw new BusinessApplicationException(ExceptionType.Concurrency, e);
                }
                catch (NotFoundDomainException e)
                {
                    throw new BusinessApplicationException(ExceptionType.NotFound, e);
                }
            }
        }
Ejemplo n.º 2
0
 public Task DeleteAsync(object key)
 {
     return(_commandRepository.DeleteAsync(key));
 }
Ejemplo n.º 3
0
        public async Task <Unit> Handle(DeleteRequest request, CancellationToken cancellationToken)
        {
            await _commandRepository.DeleteAsync(request.Id, cancellationToken);

            return(new Unit());
        }
 public virtual async Task <bool> DeleteAsync(TEntity item, CancellationToken token = default(CancellationToken), Action operationToExecuteBeforeNextOperation = null)
 {
     CheckForObjectAlreadyDisposedOrNot(typeof(CommandDomainServiceAsync <TEntity>).FullName);
     return(await InvokeAfterWrappingWithinExceptionHandling(async() => await _repository.DeleteAsync(item, token, operationToExecuteBeforeNextOperation)));
 }
Ejemplo n.º 5
0
 public virtual Task DeleteAsync(TEntity entity)
 {
     return(_commandRepository.DeleteAsync(entity));
 }
Ejemplo n.º 6
0
 public virtual async Task <bool> DeleteAsync(TEntity item, CancellationToken token = default, Action operationToExecuteBeforeNextOperation = null)
 {
     return(await InvokeAfterWrappingWithinExceptionHandling(async() => await _repository.DeleteAsync(item, token, operationToExecuteBeforeNextOperation).ConfigureAwait(false)));
 }