Code to identify logged in User

Rajnilari2015
Posted by Rajnilari2015 under ASP.NET MVC category on | Points: 40 | Views : 300
var currentUserId = User.Identity.GetUserId();
var currentUser = db.Users.FirstOrDefault(user => user.Id == currentUserId);

Comments or Responses

Login to post response