public async Task <IActionResult> Delete(Guid id) { var fileEntry = await _dispatcher.DispatchAsync(new GetEntityByIdQuery <FileEntry> { Id = id }); await _dispatcher.DispatchAsync(new DeleteEntityCommand <FileEntry> { Entity = fileEntry }); await _fileManager.DeleteAsync(fileEntry.ToModel()); return(Ok()); }
public async Task <IActionResult> Delete(FileEntry model) { var fileEntry = await _dispatcher.DispatchAsync(new GetEntityByIdQuery <FileEntry> { Id = model.Id }); await _dispatcher.DispatchAsync(new DeleteEntityCommand <FileEntry> { Entity = fileEntry }); await _fileManager.DeleteAsync(fileEntry); return(RedirectToAction(nameof(Index))); }