public ActionResult CreateSeasone(Sezone sezone) { Sezone sez = repository.Sezones.FirstOrDefault(c => c.Name == sezone.Name); if (sez != null) { ModelState.AddModelError("", "This seasone is created"); return(View()); } else { repository.InsertSeasone(sezone); return(RedirectToAction(nameof(Index), new { table = "Seasone" })); } }
public void InsertSeasone(Sezone sezone) { db.AddSezone(sezone); }