views:

15

answers:

0

Using Linq to SQL and the autogeneration capabilities of DBML, foreign key relationships create EntityRefs in the DBML designer file. For example :

private int _USStateId;

private EntityRef<USState> _USState;

However, if I have the need for a table with numerous FK relationships to the same table, how can i control the autogenerated names? For example, for a Car survey with three FKs into a Ratings table, I get

private int _BodyRatingId;
private int _ColorRatingId;
private int _PerformanceRatingId;

in my Car table with

private EntityRef<Rating> _Rating;
private EntityRef<Rating> _Rating1;
private EntityRef<Rating> _Rating2;

How can I, dynamically or other wise, control the EntityRef naming to indicate that they pertain to a particular field?

Thanks!