Keep the underscore in table column names in the class?

Keep the underscore in table column names in the class?

Postby nimli » Mon 24 Jan 2011 16:19

I'm running a test with Linq.
When the Entity Developer generates the C Sharp codes, I notice the under score (_) of the table column names are removed. For example, in the database, if I have:

CREATE TABLE table1 (
col_1_a VARCHAR;
);

the generated C Sharp code will become:

table1.col1a

Is there any way I can keep the underscore of the column name in the C Sharp codes?

Thank you.
nimli
 
Posts: 5
Joined: Fri 21 Jan 2011 22:36

Postby StanislavK » Tue 25 Jan 2011 18:14

This behaviour is defined at the 'Setup naming rule' step of the Create Model wizard. In particular, to keep underscores in the entity and property names, please disable the 'Remove underscore' check boxes.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby nimli » Tue 25 Jan 2011 18:30

Yes, this solves my problem.
I somehow missed the checkbox in my previous test.
Many thanks!
nimli
 
Posts: 5
Joined: Fri 21 Jan 2011 22:36


Return to LinqConnect (LINQ to SQL support)