MakeT4Template

Creation of a light version of T4 include template is possible with the use of MakeT4Template.vbs script.

The script includes the following code:

    Set filesDictionary = CreateObject("Scripting.Dictionary")
    Call filesDictionary.Add("Data.Common.DbSchema", "Data.Common\DbSchema.cs")
    Call filesDictionary.Add("Data.Common.IDbSchemaProvider", "Data.Common\IDbSchemaProvider.cs")
    Call filesDictionary.Add("Data.Common.DbSchemaProvider", "Data.Common\DbSchemaProvider.cs")
    Call filesDictionary.Add("system.data.sqlclient", "Data.Common\SqlServerSchemaProvider.cs")
    'Call filesDictionary.Add("system.data.sqlserverce.3.5", "Data.Common\SqlServerCeSchemaProvider.cs")
    'Call filesDictionary.Add("mysql.data.mysqlclient", "Data.Common\MySqlSchemaProvider.cs")
    'Call filesDictionary.Add("system.data.oledb", "Data.Common\OleDbSchemaProvider.cs")
    'Call filesDictionary.Add("npgsql", "Data.Common\PostgreSqlSchemaProvider.cs")


This code points to C# code files of the library. Only the four files will be included in a single T4 template. The template created will support only Microsoft SQL Server. It is possible to change the database support, by uncommenting the line that points to the provider you intend to use, and commenting all the others. Use of more that one, or all the providers is possible.

The three first files should always be included in the T4 template.

Last edited Apr 13, 2009 at 4:55 PM by gcapnias, version 2

Comments

No comments yet.