public ActionResult Create(ItemView itemView) { if (ModelState.IsValid) { //if (itemView.Type == typeItem.Ressource) //{ // if (itemView.description == null) // { // ModelState.AddModelError("description", "Obligatoire"); // return View(itemView); // } //} ItemView item = DB.AddItem(itemView); itemView.Id = item.Id; DB.AddType(itemView); return(RedirectToAction("Index", "Items")); } return(View(itemView)); }