Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

User.Identity.Name Outside a Controller

$
0
0

I am trying to get the this

User.Identity.Name,

I can get it in the controllers, but I would like to know if it can be done outside a controller on a simple class, Somethikng like this

Public string GetUserEmail()

{

var userEmail = User.Identity.Name

}


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>