public IActionResult Create(PartsFormModel model) { if (!ModelState.IsValid) { return(View(model)); } parts.CreatePart (model.Name, model.Price, model.Quantity, model.SupplierId); return(this.Redirect("all")); }