Some of the changes I made were to match MS output so we could start using LLBLGen to gen the dbml and then have MS designer generate the code.
The main reason I changed the template was to add both ThisKey and OtherKey to each relation. If the column Name does not match the Member because of casing (i.e. (content_key and Content_key), VS.NET tries to fill in the attribute (ThisKey/OtherKey) by using the pk column name, not member. It then throws an error when building.
Do you skip both sides of a relation if one side is hidden? In general I didn't find it useful to hide relations for a linq to sql project, as it doesn't understand single side hidden relations anyway.
We needed to hide some self referencing relations, if you only hide 1 side, VS.NET will remove the other. Best bet is to hide both.
Hmm, I do recall requiring the fields to be there, in situations where two entities have multiple relations with eachother (Customer 1:1 Address for example: VisitingAddress and BillingAddress). Not having the fields makes both relations to end up with the same name
I realized my issue here, when I opened the .dbml file in VS.NET, it renamed the second association name by appending a 1, I had thought the template was outputing that.
In linqToSqlMappings.lpt you removed the 'True'/'False' addition to 1:1 relations, but that's necessary due to the fact that otherwise duplicates can occur if both sides have the same name for the field (i.e. FK field and PK field are named the same).
I removed it because it was in an else of if (relation.StartEntityIsPkSide) and the true/false was outputting based on relation.StartEntityIsPkSide, so it would always output "true". I just made the IsForeignKey="true" always instead of being set by the test.
Brian Chance