public IActionResult Create(Colors colors) { var name = _db.GetColors().FindAll(a => a.Name == colors.Name).Count(); if (name == 0) { _db.AddColor(colors); return(RedirectToAction(nameof(Colors))); } ViewBag.Message = "already exists"; return(View()); }