public ActionResult Create(AgentCreate model) { if (!ModelState.IsValid) { return(View(model)); } var service = new AgentService(); if (service.CreateAgent(model)) { TempData["SaveResult"] = "The agent was created."; return(RedirectToAction("Index")); } ; ModelState.AddModelError("", "The agent could not be created."); return(View(model)); }