database when NewUser() Method calls public ActionResult NewUser(User model) { using (DbAccess db=new DbAccess()) { var original=db.users.Find(model.uid); original.isNew = true; //var entry = db.Entry(original); //entry.Property(e => e.isNew).IsModified = true; db.SaveChanges(); } return Content("Welcome"); } and public ActionResult NewUser(User model) { using (DbAccess db=new DbAccess()) { var username = User.Identity.Name; db.users.Where(m => m.username == username).FirstOrDefault(); //var user = HttpContext.User.Identity.Name; //db.users.Attach(model); //db.Entry(model).Property(x => x.isNew).IsModified = true; db.SaveChanges(); //var original=db.users.Find(model.uid); //original.isNew = true; //var entry = db.Entry(original); //entry.Property(e => e.isNew).IsModified = true; //db.SaveChanges(); } return Content("Welcome"); }
var user=db.users.Where(m => m.isNew == false).FirstOrDefault(); user.isNew = true;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)