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); } } }
public Task DeleteAsync(object key) { return(_commandRepository.DeleteAsync(key)); }
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))); }
public virtual Task DeleteAsync(TEntity entity) { return(_commandRepository.DeleteAsync(entity)); }
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))); }