tags:

views:

60

answers:

2

Hi guys,

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?

+1  A: 

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/

Rob Conery
+3  A: 

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" />
SchlaWiener
That did the trick! Thanks.