Building an mvc site using Identity 2.1 and a custom user model. There's some info in the user model that I need in almost every controller. Calling FindByNameAsync
each time hits the db more than I think necessary.
If there are a few small strings
and/or int
's that I need often, is the best idea to add them as claims to the identity when the person logs in?
identity.AddClaim(new Claim("MyInfo", "xyz"));
Or is there a more accepted practice, such as caching the user object in redis (or equivalent)?