public ActionResult Add(FormView formView) { if (ModelState.IsValid) { IFormsRepository formsRepository = new FormsRepository(db); Form form = new Form(); formView.ConvertTo(formView, form); formsRepository.Add(form); formsRepository.SaveChanges(); TempData["message"] = LayoutHelper.GetMessage("INSERT", form.FormPK); return(RedirectToAction("Index", "Form")); } else { return(View(formView)); } }