public IActionResult AddFinal(int catId, int nomId) { var category = Services.GetCategory(catId); var categoryNominees = category.Nominees; List <Nominee> newNominess = new List <Nominee>(); foreach (var nom in categoryNominees) { var nominee = Services.GetNominee(nom.NomineeId); newNominess.Add(nominee); } var nomineeAnother = Services.GetNominee(nomId); if (newNominess.Contains(nomineeAnother)) { return(RedirectToAction("AddNominees", "CategoryMVC", new { id = catId })); } var result = Services.AddNomineeToCategory(catId, nomId); if (result == true) { return(RedirectToAction("AddNominees", "CategoryMVC", new { id = catId })); } return(BadRequest()); }