How to join Aspnet_User to my custom user

送分小仙女□ 提交于 2019-12-11 05:52:44

问题


I have a User model object and I wan't to when I get this object to get aspnet_User object with it for additional data (usename etc.)

public class User
    {
        public Guid UserId_fk { get; set; }
        public int UserId { get; set; }
        public string FirstName { get; set; }

        public virtual AspnetUsers AspnetUsers { get; set; } 

    }

public class AspnetUsers
    {
        public Guid ApplicationId { get; set; }
        public Guid UserId { get; set; }
        public string UserName { get; set; }
        public string LoweredUserName { get; set; }
        public string MobileAlias { get; set; }
        public bool IsAnonymous { get; set; }
        public DateTime LastActivityDate { get; set; }

    }

In database UserId_fk is FK to aspnet_Users.UserId. How to map this?

来源:https://stackoverflow.com/questions/14920327/how-to-join-aspnet-user-to-my-custom-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!