Reputation:
My company's MySql database is riddled with fields named "system", so SubSonic's generated code clashes with the .NET System namespace.
I understand AppendWith appends a character(s) to the fields it indentifies as clashing with reserved words, but it doesn't seem to do anything in my case. Is there a way to see/update the list of reserved words it knows?
Upvotes: 0
Views: 101
Reputation: 31723
Same problem here: AppendWith does only work for reserved keywords (eg. public etc.) not for namespaces.
That's how I solved the problem (look at the regexDictionaryReplace entry)
<add name="MyDataProvider"
type="SubSonic.MySqlInnoDBDataProvider, SubSonic"
connectionStringName="myConnectionString"
generateLazyLoads="true"
regexDictionaryReplace="[sS]ystem,SystemX;[tT]able[nN]ame,TableNameX"
fixPluralClassNames="false"
generatedNamespace="My.NameSpace"
removeUnderscores="false"
generateNullableProperties="false"
generatePropertyChangedEventHandler="true"
generateRelatedTablesAsProperties="true"
excludeTableList="audit"
tableBaseClass="ActiveRecord" />
Upvotes: 3
Reputation:
You could try to use "stripTableText" to replace "system" with "". There are a lot of ways to do this and it even uses Regex if needed - have a look: http://subsonicproject.com/configuration/config-options/
Upvotes: 1