locked
Adding additional related Entities to ApplicationUser RRS feed

  • Question

  • User900906210 posted

    I am working on streamlining the number of calls in my application and I want to add related entities to the ApplicationUser on login.

    Right now the best I could come up with was to add properties I need to the Claims.  but having to call User.FindFirst("Value").Value gets to be a pain.

    Example:

    I have a related entity called CurrentAccount, and then also UserAccountAssociations.

    These related entities are in my DBContext, but they aren't in my IdentityDbContext.  

    I want to be able to access these properties anytime by using User.CurrentAccount.Id or User.CurrentAccount.Name, and so on, in a controller, razor page code behind or the .cshtml itself, anywhere in the application.

    Is this possible?

    Thursday, August 20, 2020 12:43 AM

All replies