AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Underscore(-) issue while generating tabel script #485

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.create table and table col with underscore like Emp_id,Emp_Name
2.When genrate script it give following output EmpId,EmpName actullay it should 
be Emp_Id , Emp_Name 
I also change clean Expression as ^\\w+_ but it not working.

3.I am using CodeSmith 5.2.2 Professional

What is the expected output? What do you see instead?
When genrate script it give following output EmpId,EmpName actullay it should 
be Emp_Id , Emp_Name 

What version of the product are you using?
 CodeSmith 5.2.2 Professional

Please provide any additional information below.

Original issue reported on code.google.com by junedkha...@gmail.com on 10 Aug 2010 at 5:52

GoogleCodeExporter commented 9 years ago
Issue 486 has been merged into this issue.

Original comment by bniemyjski on 10 Aug 2010 at 1:23

GoogleCodeExporter commented 9 years ago
Hello,

What set of templates is this for?

Thanks
-Blake

Original comment by bniemyjski on 10 Aug 2010 at 1:23

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 10 Aug 2010 at 1:23

GoogleCodeExporter commented 9 years ago
I am using PLINQO and one more thing i notice that if database contain two 
table with same structure suppose 
Categories and Delete_Categories Now in that case Datacontext class through 
error DeleteCategories already Exist due to removal of Underscore(-) while 
generating datacontext.

Original comment by junedkha...@gmail.com on 11 Aug 2010 at 9:25

GoogleCodeExporter commented 9 years ago
Currently if the dbml file doesn't exist then PLINQO will generate using the 
column naming conventions you are seeing. This is controlled on line 1083 of 
the following file PLINQO\Source\Generator\DbmlGenerator.cs. The call to 
StringUtil.ToPascalCase(string) will strip the underscore.  There are currently 
three workarounds to this issue. The first one would be to rename the column's 
in the DBML.

These changes will be preserved after regeneration and the column names will be 
the way you want them. The second is to use the Microsoft Designer and generate 
the DBML file and then point PLINQO's DBML template output to point to this 
generated DBML and the names will be preserved and we will manage the DBML 
file. The third way would be to update the source code mentioned above and 
recompile the solution and regenerate. 

Original comment by bniemyjski on 16 Jun 2011 at 2:57