有没有办法获取关系的元数据信息?
public partial class Contact
{
public Contact()
{
this.Addresses = new HashSet<Address>();
}
public int Id { get; set; }
public virtual ICollection<Address> Addresses { get; set; }
}
public partial class Address
{
public int Id { get; set; }
public int? ContactId { get; set; }
}
实体框架如何知道 ContactId 是外键?