1

我有一个User模型对象,当我得到这个对象时我不想aspnet_User用它来获取对象以获取其他数据(usename等)

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; }

    }

在数据库UserId_fk 中是FK to aspnet_Users.UserId. 如何映射这个?

4

0 回答 0