public ActionResult Create([Bind(Include = "Id,Nome")] Consultore consultore) { if (ModelState.IsValid) { db.Consultores.Add(consultore); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(consultore)); }
public ActionResult Create([Bind(Include = "Id,Nome,Email,IdConsultor")] Cliente cliente) { if (ModelState.IsValid) { db.Clientes.Add(cliente); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.IdConsultor = new SelectList(db.Consultores, "Id", "Nome", cliente.IdConsultor); return(View(cliente)); }