Suppose I had TableA with 2 relationship references to TableB, where TableB is the primary key (let's say it has a PrimaryBKey and SecondaryBKey columns as the FK names in TableA). So I have entity:
TableA
public TableB TableB { .. }
public TableB开发者_JS百科 TableB1 { .. }
Is there any documentation on how EF derives the naming scheme, and can it change? I have developers telling me that when they regen a table, it's changing the ordering of relationships. What I mean by that is that originally the entity was mapped in this way:
PrimaryBKey = TableB1
SecondaryBKey = TableB
But they said that it was switched later on to:
PrimaryBKey = TableB
SecondaryBKey = TableB1
Is that even possible? I can't quite find any documentation on the naming scheme to verify this.
Thanks.
These three documents will have what you are looking for, specifically the first two:
- Code First Conventions (Scroll to Relationship Convention)
- Configuring Relationships with Fluent API
- Code First Data Annotations
精彩评论