Ejemplo n.º 1
0
        public ActionResult Create(Relation relation)
        {
            if (ModelState.IsValid)
            {
                this.db.Relations.Add(relation);
                this.db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(relation);
        }
Ejemplo n.º 2
0
        public ActionResult Edit(Relation relation)
        {
            if (ModelState.IsValid)
            {
                this.db.Entry(relation).State = EntityState.Modified;
                this.db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(relation);
        }