I am using asp.net identity for signup and signin for email confirmation i am using my own code but on email confirmation i want to update the records in aspnetuser table like emailconfirmed field to true , but it is not updating
and db.savechanges()>0 always false
check the below code.
- public JsonResult RegisterConfirm(string regId)
- {
- OurHealthisWealthEntities db = new OurHealthisWealthEntities();
- var userList = UserManager.Users.Where(x=>x.Id==regId).FirstOrDefault();
- userList.EmailConfirmed = true;
- userList.PhoneNumber = "123123123123";
-
- if (db.SaveChanges()>0)
- {
- var msg = "Your Email Is Verified!";
- return Json(msg, JsonRequestBehavior.AllowGet);
- }
- else
- {
- var msg = "your email is not verified!";
- return Json(msg, JsonRequestBehavior.AllowGet);
- }
- }
Even committed line when uncomment it still not updating the record