The code of Ellbar works! You need only add using.
1 - using Microsoft.AspNet.Identity;
And... the code of Ellbar:
2 - string currentUserId = User.Identity.GetUserId();
ApplicationUser currentUser = db.Users.FirstOrDefault(x => x.Id == currentUserId);
With this code (in currentUser
), you work the general data of the connected user, if you want extra data... see this link