public IActionResult Delete(FileEntry model) { var fileEntry = _fileEntryService.GetById(model.Id); _fileEntryService.Delete(fileEntry); _fileManager.Delete(fileEntry); return(RedirectToAction(nameof(Index))); }
public IActionResult Delete(Guid id) { var fileEntry = _dispatcher.Dispatch(new GetEntityByIdQuery<FileEntry> { Id = id }); _dispatcher.Dispatch(new DeleteEntityCommand<FileEntry> { Entity = fileEntry }); _fileManager.Delete(fileEntry.ToFileEntryDTO()); return Ok(); }
public IActionResult Delete(FileEntry model) { var fileEntry = _dispatcher.Dispatch(new GetEntityByIdQuery <FileEntry> { Id = model.Id }); _dispatcher.Dispatch(new DeleteEntityCommand <FileEntry> { Entity = fileEntry }); _fileManager.Delete(fileEntry); return(RedirectToAction(nameof(Index))); }