public IActionResult Edit(int id, [Bind("SubtypeId,SubtypeName,TypeId")] Subtype subtype) { if (id != subtype.SubtypeId) { return(NotFound()); } if (ModelState.IsValid) { _subtypeRepository.Update(subtype); return(RedirectToAction(nameof(Index))); } ViewData["TypeId"] = new SelectList(_typeRepository.GetAll(), "TypeId", "TypeName", subtype.TypeId); return(View(subtype)); }