public IActionResult deletefile(int id = 0) { try { if (id > 0) { var deleteFileEntity = _fileStore.FindById(id); _fileStore.Remove(deleteFileEntity); _fileStore.Save(); var deleteEntity = _sourceFile.FindById(id); _sourceFile.Remove(deleteEntity); _sourceFile.Save(); TempData["Error"] = "File is Deleted"; } } catch (Exception ex) { TempData["Error"] = ex.Message; } return(RedirectToAction("SourceFileLoad")); }