public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } RemoveFile = await _fileContext.Delete(id.Value); return(Redirect("/Projects/Details?id=" + RemoveFile.ProjectId)); }
public async Task <ActionResult> Delete([Required] int id) { var deletedFile = await _fileDatabase.Delete(id); return(deletedFile == null ? (StatusCodeResult)NotFound() : NoContent()); }