SyntaxFix
Write A Post
Hire A Developer
Questions
You can also access the principal using the User property on ApiController.
User
ApiController
So the following two statements are basically the same:
string id; id = User.Identity.GetUserId(); id = RequestContext.Principal.Identity.GetUserId();