protected async Task OnDeleteAsync(TId id, CancellationToken cancellationToken) { if (Equals(id, Guid.Empty)) { return; } await _repository.DeleteAsync(id, cancellationToken); }
public async Task DeleteAsync(string id) { var fileHistory = await _fileHistoryRepository.GetByIdAsync(id); if (fileHistory == null) { _logger.LogWarning(LoggingEvents.HaveException, $"Not found deleting file"); throw new NotFoundException(nameof(FileHistory), id); } await _fileHistoryRepository.DeleteAsync(id); }