我有一个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
。
如何映射?