public ActionResult RemoveInstrument(int instrumentId, string instrumentName) { if (_dashboardSP.CheckDelete <Instrument>(instrumentId)) { TempData["CustomError"] = "Can't Delete. There are instruments for Musician ( " + instrumentName + " )"; ModelState.AddModelError("CustomError", "Can't Delete. There are instruments for Musician ( " + instrumentName + " )"); } else { _dashboardSP.Remove <Instrument>(instrumentId); } return(RedirectToAction("Index")); }