diff Tools/Templates.VB/DataModel.tt @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Tools/Templates.VB/DataModel.tt	Thu Mar 27 21:46:09 2014 +0400
@@ -0,0 +1,39 @@
+<#@ template language="C#" debug="True" hostspecific="True" #>
+<#@ output extension=".generated.vb" #>
+<#@ include file="$(SolutionDir)\Source\Templates\BLToolkit.ttinclude"     #>
+<#@ include file="$(SolutionDir)\Source\Templates\BLT4Toolkit.ttinclude"   #>
+<#@ include file="$(SolutionDir)\Source\Templates\MSSQL.ttinclude"         #>
+<#@ include file="$(SolutionDir)\Source\Templates\WCFAttributes.ttinclude" #>
+<#@ include file="$(SolutionDir)\Source\Templates\VB.ttinclude"            #>
+<#
+	//ConnectionString     = "Data Source=DBHost;Port=5000;Database=BLToolkitData;Uid=sa";
+	//DataProviderAssembly = @"E:\Projects\SVN\BLToolkit\trunk\Redist\Sybase\Sybase.AdoNet2.AseClient.dll";
+
+	//ConnectionString     = "Server=.;Database=BLToolkitData;Integrated Security=SSPI";
+	ConnectionString     = "Server=.;Database=Northwind;Integrated Security=SSPI";
+
+	//Namespace       = "Templates";
+	//DataContextName = "Test";
+
+	BaseEntityClass = "EntityBase";
+
+	RenderField = true;
+
+	LoadMetadata();
+
+	//Tables["BinaryData"].Columns["BinaryDataID"].MemberName = "ID";
+
+	Tables["Employees"].ForeignKeys["FK_Employees_Employees"].MemberName = "ReportsToEmployee";
+
+	foreach (var t in Tables.Values)
+		foreach (var c in t.Columns.Values)
+			if (c.IsPrimaryKey && t.TableName + "ID" == c.ColumnName)
+				c.MemberName = "ID";
+
+	foreach (var t in Tables.Values)
+		t.BaseClassName = "EntityBase(Of " + t.ClassName + ")";
+
+	Usings.Add("BLToolkit.Common");
+
+	GenerateModel();
+#>