I want to be able to display various details about the member ("user") on each page, i.e. partial, which displays some login information.
For example, stackoverflow shows my username, my reputation, and badges on every page.

Since we like to stick with ViewModels, it seems reasonable to populate the ViewModel and pass it to each page. The ViewModel will contain a member object (and possibly other data).
One way to do this is to create an abstract “base” ViewModel class and have all the other ViewModels that you usually use inherit from it. This seems a little cumbersome, since every ViewModel you create must inherit from the base. Annoying?
Another way is to use HttpContext.User.Identity .
Another way is to create a custom WebViewPage.
But for these two possibilities, I was informed that this is not recommended, because it is "not very MVC-ish". That is, this does not correspond to the natural way of working in MVC.
How can I solve this problem? Is ViewModels the Way?
C # or VB.NET are acceptable.
source share