I use ASP.NET Identity 2.0 and MVC. I need to logged user\'s name,surname,email etc.. in view. How can get it? I can get just @User.Identity but there no my user class\'s pr
There are two ways you can achieve this.
1) Create your own CustomPrincipal
by inheriting IPrincipal
interface to include Name
, Surname
and Email
using this example or this one.
2) Get details directly from the database and pass it as a model to the view.
Method one will be good option if you want to use same user details in several views, but method two is the simplest way to achieve this. let me know if you need any code help for the second method.