예제 #1
0
        public IActionResult AddSpecies(Species species)
        {
            var name = _db.GetSpecies().FindAll(a => a.Name == species.Name).Count();

            if (name == 0)
            {
                _db.AddSpecies(species);

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