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";
- //db.Entry(userList).State = EntityState.Modified;
- 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

Vinay SinghRank #604 · 4K reputationPosted Mar 30, 2020, 7:06 PM EDT
Mark TaborRank #914 · 2.3K reputationPosted Mar 30, 2020, 7:15 PM EDT
Vinay Singh thanks for the response , basically my this line
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 30, 2020, 8:31 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Mar 30, 2020, 9:33 PM EDT
Mark TaborRank #914 · 2.3K reputationPosted Mar 30, 2020, 10:04 PM EDT
Jignesh Kumar I have data in the table and var userList = UserManager.Users.Where(x=>x.Id==regId).FirstOrDefault(); this row find the record as well but when i am updating emailconfirmed field it is not getting updated ,
Mark TaborRank #914 · 2.3K reputationPosted Mar 30, 2020, 11:25 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Mar 30, 2020, 11:42 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Mar 30, 2020, 11:48 PM EDT
Mark TaborRank #914 · 2.3K reputationPosted Mar 30, 2020, 11:57 PM EDT
Vinay SinghRank #604 · 4K reputationPosted Mar 31, 2020, 12:39 AM EDT
Mark TaborRank #914 · 2.3K reputationPosted Mar 31, 2020, 12:41 AM EDT
Mark TaborRank #914 · 2.3K reputationPosted Mar 31, 2020, 10:08 AM EDT
??