I need GUID (UserId) at many places in my application. Currently I am making calls to Membership.GetUser() to get the UserId. Does this method make a database call or it caches the details?
If it makes a database call then it is better to store in Session. Any hints?
The
Membership.GetUser()method gets the information from the data source and updates the last-activity date/time stamp for the current logged-on membership user.You might want to implement
IIdentitywith a UserId property so it will be part of the authentication ticket..