Codesmith is a code generation tool for. NET, and many of its own templates are almost all systems for SQL Server architecture, and when Oracle is used, many templates need to be customized because of the differences between Pl-sql and T-SQL. There are even many templates to rewrite, since most people use an underscore style to name variables while using an Oracle database. NET development has not advocated the use of underlined way to name variables, so I decided to codesmith in the template to convert this style, in the Codesmith to add later template code:
Convert code
1<script runat= "Template" >
2public string Getfixname (String strval)
3{
4
5 String strreturnval = "";
6 string[]strvals = Strval.split ('_');
7 foreach (String str in strvals)
8 {
9 Strreturnval + + str. Substring (0,1) + str. Substring (1). ToLower ();
10}
One return strreturnval;
12}
13</script> when you want to use a table name, a field that is mapped to an object, an object's property process, you can convert the original name by using the function above to reach an effect consistent with the. NET encoding specification.