Ejemplo n.º 1
0
 protected async Task OnDeleteAsync(TId id, CancellationToken cancellationToken)
 {
     if (Equals(id, Guid.Empty))
     {
         return;
     }
     await _repository.DeleteAsync(id, cancellationToken);
 }
Ejemplo n.º 2
0
        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);
        }