SubSonic-3.0 icon indicating copy to clipboard operation
SubSonic-3.0 copied to clipboard

SQLite Table Names and T4 Template

Open ScGit opened this issue 16 years ago • 4 comments

Using SQLite v3 and ActiveRecord pattern.Created a table named "User.Categories". When the T4 template is run, the "." in the name seems to cause a problem with namespaces and therefore class generation.

ScGit avatar Aug 25 '09 15:08 ScGit

You need to update the ActiveRecord.tt file's CleanUp method to remove any "." and replace it with string.empty or underscore, etc. You may run into another bug (seee #107), but the CleanUp method will get you past this first hurdle.

jamesewelch avatar Aug 26 '09 16:08 jamesewelch

I found the CleanUp method in Settings.ttinclude, I'll make the change and see what happens. It would be nice to be able to use periods though...

Thanks!

ScGit avatar Aug 27 '09 14:08 ScGit

You can't use periods because that's used to separate classes, namespaces, methods, properties, etc. It's a reserved symbol (that's probably not the correct phrase) just like how "*", commas, semicolons, etc. can't be used in a object's name.

jamesewelch avatar Aug 28 '09 17:08 jamesewelch

It'd be nice to improve CleanUp for version 3.1 we should consider this

adam7 avatar Feb 09 '10 18:02 adam7