I'm new to MVC and have a question. The Visual Studio template creates a table dbo.AspNetUsers
that has a column called Id
. From my controller I want to get that value for the user who is signed in
public ActionResult Index ()
{
if (!Request.IsAuthenticated) // if not logged in
{
Response.StatusCode = 404;
return null;
}
else
{
string thisUserId = ???
// do something with thisUserId
}
I've looked through the source files but can't figure out how I get this.