Exemplo n.º 1
0
        public ActionResult Edit(int id, ClassInfo data)
        {
            try
            {
                dbcontext.Entry(data).State = System.Data.Entity.EntityState.Modified;
                dbcontext.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult Edit(int id, ClassInfo data)
        {
            try
            {
                // TODO: Add update logic here
                dbcontext.ClassInfo.Attach(data);
                dbcontext.Entry(data).State = System.Data.Entity.EntityState.Modified;
                dbcontext.SaveChanges();

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }