R – Table and Column names causing problems

namingoperator-keywordsubsonic

I have an issue when the T4 linq templates generate the classes for my MySql db using subsonic 3.

It looks like one of our table names "operator" is causing problems in the Context.cs generated class. In the following line of code in Context.cs Visual Studio sees <operator> as a c# operator and generates a compilation error of "Type expected"

public Query<operator> operators { get; set; }

Is there anyway I can work around this without having to rename my database table and column names? For example hard coding something in Settings.ttinclude to use or map different names to specific db tables and columns?

Best Answer

The CleanUp() function was built for this - it's in Settings.tt. You should be able to rename your class as needed.