示例#1
0
 public int Update(Student s)
 {
     s.DateModified          = DateTime.Now;
     _context.Entry(s).State = EntityState.Modified;
     _context.Entry(s).Property(x => x.DateCreated).IsModified = false;
     return(_context.SaveChanges());
 }
        public ActionResult EditCategory(tbl_Category category)
        {
            MVCWebAppDbContext db = new MVCWebAppDbContext();

            db.Entry(category).State = System.Data.Entity.EntityState.Modified;

            db.SaveChanges();

            return(RedirectToAction("ListCategory"));
        }