We have a table (Organization_XREF) that contains two foreign key columns (Parent_ID and Child_ID) that both refer to the same primary key column (OrganizationID) in the Organization table, as depicted in this diagram.
When we run EF RPCFG over this relationship, it generates the HasMany relationship in the Organization_OrganizationConfiguration class as follows:
Has anyone else encountered a similar problem? How did you work around this? This is a critical issue for us, as it has broken our API.
When we run EF RPCFG over this relationship, it generates the HasMany relationship in the Organization_OrganizationConfiguration class as follows:
HasMany(t => t.Organization_Organization).WithMany(t => t.Organization_Organization).Map(m =>
{
m.ToTable("Organization_XREF", schema);
m.MapLeftKey("ChildId");
m.MapRightKey("ParentId");
});
This code will not compile. The compiler is unable to infer the type of the argument to HasMany, likely because there is no Organization_Organization property generated for the Organization_Organization model. Has anyone else encountered a similar problem? How did you work around this? This is a critical issue for us, as it has broken our API.