Exemplo n.º 1
0
        public ActionResult Update([Bind(Exclude = "Songs")] myType myType)
        {
            if (ModelState.IsValid)
            {
                db.Entry(myType).State = EntityState.Modified;
                db.SaveChanges();
            }

            return(Json(myType, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Exclude = "myTypeId,Songs")] myType myType)
        {
            if (ModelState.IsValid)
            {
                db.myTypes.Add(myType);
                db.SaveChanges();
            }

            return(Json(myType, JsonRequestBehavior.AllowGet));
        }