locked
ASP.Net Identity 2.0 Update Email ? RRS feed

  • Question

  • User-72415733 posted

    How does one update an email address in ASP.Net Identity 2.0 ?

    Tuesday, May 20, 2014 8:09 AM

Answers

  • User697462465 posted

    Hi jimpevans,

    As far as I know, the IdentityUser have no email field inaps.net identity 2.0 as following code:

    public class IdentityUser : IUser
        {
            public IdentityUser();
            public IdentityUser(string userName);
    
            public virtual ICollection<IdentityUserClaim> Claims { get; }
            public virtual string Id { get; set; }
            public virtual ICollection<IdentityUserLogin> Logins { get; }
            public virtual string PasswordHash { get; set; }
            public virtual ICollection<IdentityUserRole> Roles { get; }
            public virtual string SecurityStamp { get; set; }
            public virtual string UserName { get; set; }
        }

    if you have create your email model by manually, please post some of your code here.

    Best Regards,
    Terry Guo

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 22, 2014 1:55 AM

All replies

  • User697462465 posted

    Hi jimpevans,

    As far as I know, the IdentityUser have no email field inaps.net identity 2.0 as following code:

    public class IdentityUser : IUser
        {
            public IdentityUser();
            public IdentityUser(string userName);
    
            public virtual ICollection<IdentityUserClaim> Claims { get; }
            public virtual string Id { get; set; }
            public virtual ICollection<IdentityUserLogin> Logins { get; }
            public virtual string PasswordHash { get; set; }
            public virtual ICollection<IdentityUserRole> Roles { get; }
            public virtual string SecurityStamp { get; set; }
            public virtual string UserName { get; set; }
        }

    if you have create your email model by manually, please post some of your code here.

    Best Regards,
    Terry Guo

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 22, 2014 1:55 AM
  • User-2033897466 posted

    you can use the method UserManager.SetEmail method to set the email on the user. You might want to look at the flow where the user needs to confirm the email address to confirm the registered email. Install the Micorosft.AspNet.Identity.samples packages on an empty application to view the sample code

    Friday, May 23, 2014 4:29 PM
  • User913442891 posted

    follow this tutorial...it gives you an opportunity to change asp.net code version

    http://msdn.microsoft.com/en-us/library/40w5063z(v=vs.110).aspx

    mark as answered

    Monday, May 26, 2014 9:37 PM