Esempio n. 1
0
        public ActionResult Create([Bind(Include = "color,ID,name")] company company)
        {
            if (ModelState.IsValid)
            {
                db.companies.Add(company);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(company));
        }
Esempio n. 2
0
        public ActionResult Create([Bind(Include = "color2,location,Description")] child child)
        {
            if (ModelState.IsValid)
            {
                db.children.Add(child);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(child));
        }