예제 #1
0
        public ActionResult Create([Bind(Include = "ID,CName,CDifficulty")] Chore chore)
        {
            if (ModelState.IsValid)
            {
                db.Chores.Add(chore);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(chore));
        }
예제 #2
0
        public ActionResult Create([Bind(Include = "ID,FirstName,LastName")] Roommate roommate)
        {
            if (ModelState.IsValid)
            {
                db.Roommates.Add(roommate);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(roommate));
        }