【发布时间】:2016-08-26 20:20:20
【问题描述】:
我找到了这个链接:
How to get the current logged in user Id ASP.NET Core
但答案都已经过时了!
这个 SO 帖子也不能成为解决方案,它只是一个样板解决方法:How should I access my ApplicationUser properties from within my MVC 6 Views?
在 mvc 操作中:base.User 不是 ApplicationUser 类型,base.User.Identity 也不是。两者都不能转换为 ApplicationUser。
那么我如何在登录时访问我放在 applicationuser 对象中的自定义属性?
【问题讨论】:
标签: asp.net-core asp.net-core-mvc