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
Mark TaborPosted Mar 31, 2020, 2:08 PM
??
Mark TaborPosted Mar 31, 2020, 4:41 AM
Vinay SinghPosted Mar 31, 2020, 4:39 AM
Mark TaborPosted Mar 31, 2020, 3:57 AM
Vinay SinghPosted Mar 31, 2020, 3:48 AM
Jignesh KumarPosted Mar 31, 2020, 3:42 AM
Mark TaborPosted Mar 31, 2020, 3:25 AM
Mark TaborPosted Mar 31, 2020, 2:04 AM
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 ,
Vinay SinghPosted Mar 31, 2020, 1:33 AM
Jignesh KumarPosted Mar 31, 2020, 12:31 AM
Mark TaborPosted Mar 30, 2020, 11:15 PM
Vinay Singh thanks for the response , basically my this line
Vinay SinghPosted Mar 30, 2020, 11:06 PM