Which package lets me query User.Identity in a ASP.Net Core Class Libary? -


i writing class library asp.net core mvc application. in webui package can directly call user.identity name property of current user when try access user.identity in class library user recognized not have property called identity. because there no documentation having problem figuring out package add class library can query user.identity name of logged in user. know package need ad?

user property of controller why wouldn't able see if in same way in class library. isn't going answer question shouldn't tie class library mvc in opinion, technology should isolated web project. change class library accept iprincipal parameter (or string parameter take name if that's need) on method(s) needs user's identity , pass user.identity web site project.

of course if you're determined user in class library can using system.web.httpcontext.current.user.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -