public IActionResult Create([Bind("TypeId,TypeName")] DAL.Models.Type @type) { if (ModelState.IsValid) { _repository.Create(@type); return(RedirectToAction(nameof(Index))); } return(View(@type)); }
public IActionResult Edit(int id, [Bind("TypeId,TypeName")] DAL.Models.Type @type) { if (id != @type.TypeId) { return(NotFound()); } if (ModelState.IsValid) { _repository.Update(@type); return(RedirectToAction(nameof(Index))); } return(View(@type)); }