Search code examples
c#asp.net-coreasp.net-identityrazor-pagesasp.net-core-identity

How can i Customize User In Identity 3.1?


so , I wan to modify my User Model , I want to add a new property named FullName (which is an string) to My User Model.

I'm Newbie to Identity And I Don't have any idea about how can i do this.

I'm using Razor Pages Web Application Project and have the identity 3.1 working fine but i need to add FullName property to my users.

i've seen the documentation of microsoft and some other posts but i don't understand them :(


Solution

  • You will have to create your own User class, lets' say ApplicationUser, which will have to extend the IndentityUser class, so a sample ApplicationUser with FullName would look like this:

        public class ApplicationUser : IdentityUser
        {
            public string FullName { get; set; }
        }
    

    You might also have to adjust your DbContext class, could you share it?