在
this blog的帮助下,我向ApplicationUser类添加了一个自定义配置文件属性OfficeKey(在IdentityModels.cs文件中):
public class ApplicationUser : IdentityUser { public int OfficeKey { get; set; } //remaining code here }
User.Identity.Name
How do I get custom user data OfficeKey?@H_502_5@
我试过这些:@H_502_5@
How to get Identity User Data from Asp.net mvc Model@H_502_5@
How to get user email address from ASP.NET MVC Default Mempership Model?@H_502_5@