How to join Aspnet_User to my custom user

2019-08-08 11:43发布

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?

0条回答
登录 后发表回答