Skip to content

Instantly share code, notes, and snippets.

@garraflavatra
Created September 26, 2021 11:26
Show Gist options
  • Save garraflavatra/7a3b76b243d26815301b0e95e2559100 to your computer and use it in GitHub Desktop.
Save garraflavatra/7a3b76b243d26815301b0e95e2559100 to your computer and use it in GitHub Desktop.
ASP.NET Core: get current user's ID
using Microsoft.AspNetCore.Identity;
string UserID = User.FindFirstValue(ClaimTypes.NameIdentifier);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment