Edit - Cleaning up question to better reflect the actual issue:
I'm using SQLMetal to generate database classes from our SQL Server db. Recently, I needed to add a table that had multiple foreign keys pointing to the same table. Using LINQPad to play around with the new tables, I was able to access properties for both foreign keys like so:
- record.FK_AId
- record.FK_BId
- record.FKA
- record.FKB
...which is just how I would expect it. The problem is, the classes generated by SQLMetal produce these properties:
- record.FK_AId
- record.FK_BId
- record.FKA
- record.FKBTableNameGoesHere
Now I could just cange the generated classes so FKBTableNameGoesHere would be FK_B, but the generated files are changed very often by different team members, so that would be a huge pain. Is there an easy fix for this?
Thanks in advance.
Edit 2 So, I thought the solution would be to just create a partial class that had a property named what I wanted it to be, and let the getter/setter point to the poorly named property. That worked for selecting, but not using it in where clauses and such. ANYONE have a solution??