public class UserInfo
{
public int id {get;set;} //Primary key
public string UserId {get; set;} // Foreign key to AspNetUser - Id
public string FirstName {get;set;}
public string LastName {get;set;}
......
......
}
如何以EF6代码第一种方式以上述方式扩展AspNetUser表?
答案 0 :(得分:1)
也许,ForeignKey
属性可以帮助您:
public string UserId {get; set;}
[ForeignKey("UserId")]
public AspNetUser User {get; set;}