public async Task <IActionResult> DeleteConfirmed(string id) { try { await _candidate.DeleteCandidate(id); return(RedirectToAction(nameof(Index))); } catch { return(RedirectToAction(nameof(HomeController.Error), "Home")); } }