Sql – Problem about ActiveRecord Templates for SQLite

activerecordsqlitesubsonicsubsonic3

I try to using the SQLite in SubSonic.Examples.ActiveRecord project so:

  1. Add a reference for System.Data.SQLite
  2. Copy the SQLite.ttinclude and Settings.ttinclude from \T4 Templates\TemplateProviders\ to the Models_Generated\
  3. Change the <#@ include file="SQLite.ttinclude" #> in the SQLite.ttinclude and Settings.ttinclude
  4. Change the settings: Namespace, ConnectionStringName, DatabaseName to "Blog" in the Settings.ttinclude file.

I meet two errors when regenerate the code:
first one is because of missing a "break" at SQLite.ttinclude line #80

case "long":
case "integer":
    sysType= "long";
    break;  // missing a break
case "guid":

After add a "break" the code file "Context.cs" can generate successfully, but the ActiveRecord.cs can not generate, there is a Warning:

Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive. D:\LP\Study\SubSonic 3 Final\Examples\SubSonic.Examples.ActiveRecord\Models_Generated\Settings.ttinclude 1 4

Best Answer

I download the latest version from SubSonic's github and everything is OK!

The new version a new T4 file: Structs.tt