public IActionResult CreateNinja(NinjaVM model) { if (ModelState.IsValid) { Ninja ninja = new Ninja { name = model.name, level = model.level, dojo_id = model.dojo_id == 0 ? null : model.dojo_id, description = model.description, }; _ninjaFactory.Create(ninja); return(RedirectToAction("Index")); } return(View("Index")); }