例如,我必须上课:当 AId 是 FK 时,我想在 B 类到 A 类之间创建 NavigationPropertyLink。我成功地为集合做到了,但未能为 int 做到这一点。我想要去的能力
A 到 B 类。
Class A
{
public int Id { get; set; }
public int Name { get; set; }
}
Class B
{
public int Id { get; set; }
public int AId { get; set; }//This is a FK to class A
public int Name { get; set; }
}
ODataModelBuilder builder = new ODataModelBuilder();
EntitySetConfiguration<A> aEntity = builder.EntitySet<A>("A");
EntitySetConfiguration<B> bEntity = builder.EntitySet<B>("B");