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?
In T4 you can use “class features” to include your own custom helper functions and like that. Something like this:
And use that helper function to create your custom mapping in EF.
Original answer:
Use TextInfo.ToTitleCase!