public async Task <IActionResult> OnGetDownload(int?id) { if (id == null) { return(Page()); } var downloadfile = await _fileContext.SingleOrDefaultAsync(id.Value); return(PhysicalFile(downloadfile.FilePath, MediaTypeNames.Application.Octet, downloadfile.Name)); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } RemoveFile = await _fileContext.SingleOrDefaultAsync(id.Value); Project = await _projectContext.FindOrDefault(RemoveFile.ProjectId); if (RemoveFile == null) { return(NotFound()); } return(Page()); }