Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8197941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:50:47+00:00 2026-06-07T05:50:47+00:00

In the past when I have used Oracle and the Entity Framework, database-first, I’ve

  • 0

In the past when I have used Oracle and the Entity Framework, database-first, I’ve manually adjusted the model (defaults to upper snake case) so that entity names and property names use the conventional PascalCase. This manual editing been OK because the schemas I’ve modeled so far are fairly small.

But I am going to start a project with a very large schema, and I can’t imagine spending all that time manually adjusting everything for hundreds of tables. I also can’t stand the thought of using the default upper snake casing. I think most C# developers would agree that it’s pretty repulsive.

I am not experienced in using T4, but it seems this type of thing shouldn’t be terribly difficult. But maybe I’m wrong because Google hasn’t been able to help me find any pascal casing templates. Can anyone share a .t4 file that converts the casing conventions, or point me in a direction that would help me write my own?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:50:49+00:00Added an answer on June 7, 2026 at 5:50 am

    In T4 you can use “class features” to include your own custom helper functions and like that. Something like this:

    <#+
    public String ConvertToPascalCase(string allCaps){
       CultureInfo cultureInfo = CultureInfo.InvariantCulture;
       TextInfo textInfo = cultureInfo.TextInfo;
    
       return textInfo.ToTitleCase(allCaps.ToLower()).Replace("_", "");
    }
    #>
    

    And use that helper function to create your custom mapping in EF.

    Original answer:

    Use TextInfo.ToTitleCase!

    //your current culture
    //CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
    //or invariant culture, made no difference for me...
    CultureInfo cultureInfo = CultureInfo.InvariantCulture;
    TextInfo textInfo = cultureInfo.TextInfo;
    
    string allCaps = "THIS_IS_ORACLE";
    
    var result = textInfo.ToTitleCase(allCaps.ToLower()).Replace("_", "");
    
    result.Dump();//tried it in LINQPad, result: "ThisIsOracle"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the past I have used MAPISendMail to launch Outlook (or whatever the desired
In the past I have used Managed Direct X and DirectShow.Net to play a
Excuse my limited knoweldge here. In the past I have used Steve Sanderson's method
I have used JMS in the past to build application and it works great.
I have used Hibernate in the past and I share many people's frustration with
I have used valgrinds massif tool to monitor memory usage in the past. Does
I have used the code supplied in the following CodeProject article in the past
I do used IntelliJ IDEA as my development environment at past and I have
In the past I have stored database credentials (username, password) in another file (outside
In the past I have used the following method to parse the json data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.