Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "ID,otherthing1,otherthing2,otherthing3")] ParentTable parentTable)
        {
            if (ModelState.IsValid)
            {
                db.ParentTables.Add(parentTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(parentTable));
        }
        public ActionResult Create([Bind(Include = "ID,PID,thing1,thing2")] ChildTable childTable)
        {
            if (ModelState.IsValid)
            {
                db.ChildTables.Add(childTable);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(childTable));
        }