L
Lothar Behrens
Hi,
I have two tables and one points to the other with three foreign keys,
but with different names.
The Linq To SQL designer generates integer fields for the foreign keys
with a meaningful name, but
the object instance with one row of the referenced table has not a
well meaning name.
Sample:
Table Object -> Table Customer
Col CustBuy -> id
Col CustSell -> id
The generated code has integer fields like these:
int? CustBuy;
int? CustSell;
But not meaningful names for the objects:
Customer Customer1;
Customer Customer2;
When using that in code, one doesn't well understand the code when
using the object names.
How could I change this 'rule to generate code' to say getting this
code?:
int? CustBuy;
int? CustSell;
But not meaningful names for the objects:
Customer oCustBuy;
Customer oCustSell;
Then it would be easy to understand the generated code and it will be
easy to work with it.
II have renamed the objects in the dbml model and then I got
meaningful code, but then I am unable
to reverse engineer from the SQL server as I have modified my changes
in SQL server and not in the DBML.
Any thougths?
How to model and forward engineer (I haven't determined how this would
work)?
Thanks
Lothar
I have two tables and one points to the other with three foreign keys,
but with different names.
The Linq To SQL designer generates integer fields for the foreign keys
with a meaningful name, but
the object instance with one row of the referenced table has not a
well meaning name.
Sample:
Table Object -> Table Customer
Col CustBuy -> id
Col CustSell -> id
The generated code has integer fields like these:
int? CustBuy;
int? CustSell;
But not meaningful names for the objects:
Customer Customer1;
Customer Customer2;
When using that in code, one doesn't well understand the code when
using the object names.
How could I change this 'rule to generate code' to say getting this
code?:
int? CustBuy;
int? CustSell;
But not meaningful names for the objects:
Customer oCustBuy;
Customer oCustSell;
Then it would be easy to understand the generated code and it will be
easy to work with it.
II have renamed the objects in the dbml model and then I got
meaningful code, but then I am unable
to reverse engineer from the SQL server as I have modified my changes
in SQL server and not in the DBML.
Any thougths?
How to model and forward engineer (I haven't determined how this would
work)?
Thanks
Lothar