Пример #1
0
        public ActionResult Edit(League league)
        {
            if (ModelState.IsValid)
            {
                LeagueManager leagueManager = new LeagueManager(_context);

                if (league.LeagueId == 0)
                {
                    leagueManager.Add(league);
                }
                else
                {
                    leagueManager.Update(league);
                }

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(league));
            }
        }