Remove the Oracle underline in the Codesmith

Source: Internet
Author: User
Tags table name oracle database

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.