I have created a new class that I want to manage a few things, one of which is to get the User Id Microsoft.AspNet.Identity
. I get this error message
CS0103 The name 'User' does not exist in the current context
And this is my code:
using Microsoft.AspNet.Identity;
public string UserId
{
get
{
return User.Identity.GetUserId();
}
}
I was expecting intellisense to pick up the Microsoft.AspNet.Identity
GetUserId
method, but I get the error below.
What am I doing wrong and why can't it pick up the UserId
from Microsoft.AspNet.Identity
.