我在我的MVC应用程序中使用web Api,我想通过以下代码在我的api中获取用户身份:
User.Identity.Name
但它不起作用,虽然它在控制器等其他地方运行良好!
是否有任何解决方案可以从Web API访问User.Identity.Name?
c# asp.net-mvc asp.net-web-api asp.net-web-api2
asp.net-mvc ×1
asp.net-web-api ×1
asp.net-web-api2 ×1
c# ×1