예제 #1
0
        public IActionResult AddSeason(Seasons seasons)
        {
            var name = _db.GetSeasons().FindAll(a => a.Name == seasons.Name).Count();

            if (name == 0)
            {
                _db.AddSeasons(seasons);

                return(RedirectToAction(nameof(GetSeasons)));
            }
            ViewBag.Message = "already exists";
            return(View());
        }