This repository has been archived by the owner on Dec 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
99 changed files
with
1,403 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<#@ template language="C#" debug="True" hostSpecific="True" #> | ||
<#@ output extension=".generated.cs" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\LinqToDB.Firebird.Tools.ttinclude" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\PluralizationService.ttinclude" #> | ||
<# | ||
/* | ||
1. Copy this file to a folder where you would like to generate your data model, | ||
rename it, and delete .txt extension. For example: | ||
|
||
MyProject | ||
DataModels | ||
MyDatabase.tt | ||
|
||
2. Modify the connection settings below to connect to your database. | ||
|
||
3. Add connection string to the web/app.config file: | ||
|
||
<connectionStrings> | ||
<add name="MyDatabase" connectionString="DataSource=MyServer;Database=C:\Data\MyDatabase.fdb;User Id=SYSDBA;Password=masterkey" providerName="Firebird" /> | ||
</connectionStrings> | ||
|
||
4. To access your database use the following code: | ||
|
||
using (var db = new MyDatabaseDB()) | ||
{ | ||
var q = | ||
from c in db.Customers | ||
select c; | ||
|
||
foreach (var c in q) | ||
Console.WriteLine(c.ContactName); | ||
} | ||
|
||
5. See more at https://github.com/linq2db/t4models | ||
*/ | ||
|
||
NamespaceName = "DataModels"; | ||
|
||
LoadFirebirdMetadata("MyServer", @"C:\Data\MyDatabase.fdb"); | ||
// LoadFirebirdMetadata(string server, string database, string uid, string password); | ||
// LoadFirebirdMetadata(string connectionString); | ||
|
||
GenerateModel(); | ||
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<#@ template language="C#" debug="True" hostSpecific="True" #> | ||
<#@ output extension=".generated.cs" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\LinqToDB.MySql.Tools.ttinclude" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\PluralizationService.ttinclude" #> | ||
<# | ||
/* | ||
1. Copy this file to a folder where you would like to generate your data model, | ||
rename it, and delete .txt extension. For example: | ||
|
||
MyProject | ||
DataModels | ||
MyDatabase.tt | ||
|
||
2. Modify the connection settings below to connect to your database. | ||
|
||
3. Add connection string to the web/app.config file: | ||
|
||
<connectionStrings> | ||
<add name="MyDatabase" connectionString="Server=MyServer;Port=3306;Database=MyDatabase;Uid=root;Pwd=TestPassword;charset=utf8;" providerName="MySql.Data.MySqlClient" /> | ||
</connectionStrings> | ||
|
||
4. To access your database use the following code: | ||
|
||
using (var db = new MyDatabaseDB()) | ||
{ | ||
var q = | ||
from c in db.Customers | ||
select c; | ||
|
||
foreach (var c in q) | ||
Console.WriteLine(c.ContactName); | ||
} | ||
|
||
5. See more at https://github.com/linq2db/t4models | ||
*/ | ||
|
||
NamespaceName = "DataModels"; | ||
|
||
LoadMySqlMetadata("MyServer", "MyDatabase", "root", "TestPassword"); | ||
// LoadMySqlMetadata(string connectionString); | ||
|
||
GenerateModel(); | ||
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<#@ template language="C#" debug="True" hostSpecific="True" #> | ||
<#@ output extension=".generated.cs" #> | ||
<#@ include file=$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\LinqToDB.PostgreSQL.Tools.ttinclude" #> | ||
<#@ include file=$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\PluralizationService.ttinclude" #> | ||
<# | ||
/* | ||
1. Copy this file to a folder where you would like to generate your data model, | ||
rename it, and delete .txt extension. For example: | ||
|
||
MyProject | ||
DataModels | ||
MyDatabase.tt | ||
|
||
2. Modify the connection settings below to connect to your database. | ||
|
||
3. Add connection string to the web/app.config file: | ||
|
||
<connectionStrings> | ||
<add name="MyDatabase" connectionString="Server=MyServer;Port=5432;Database=MyDatabase;User Id=postgres;Password=TestPassword;Pooling=true;MinPoolSize=10;MaxPoolSize=100;Protocol=3;" providerName="PostgreSQL" /> | ||
</connectionStrings> | ||
|
||
4. To access your database use the following code: | ||
|
||
using (var db = new MyDatabaseDB()) | ||
{ | ||
var q = | ||
from c in db.Customers | ||
select c; | ||
|
||
foreach (var c in q) | ||
Console.WriteLine(c.ContactName); | ||
} | ||
|
||
5. See more at https://github.com/linq2db/t4models | ||
*/ | ||
|
||
NamespaceName = "DataModels"; | ||
|
||
LoadPostgreSQLMetadata("MyServer", "5432", "MyDatabase", "postgres", "TestPassword"); | ||
// LoadPostgreSQLMetadata(string connectionString); | ||
|
||
GenerateModel(); | ||
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<#@ template language="C#" debug="True" hostSpecific="True" #> | ||
<#@ output extension=".generated.cs" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\LinqToDB.SQLite.Tools.ttinclude" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\PluralizationService.ttinclude" #> | ||
<# | ||
/* | ||
1. Copy this file to a folder where you would like to generate your data model, | ||
rename it, and delete .txt extension. For example: | ||
|
||
MyProject | ||
DataModels | ||
MyDatabase.tt | ||
|
||
2. Modify the connection settings below to connect to your database. | ||
|
||
3. Add connection string to the web/app.config file: | ||
|
||
<connectionStrings> | ||
<add name="MyDatabase" connectionString="Data Source=MyDatabase.sqlite" providerName="SQLite" /> | ||
</connectionStrings> | ||
|
||
4. To access your database use the following code: | ||
|
||
using (var db = new MyDatabaseDB()) | ||
{ | ||
var q = | ||
from c in db.Customers | ||
select c; | ||
|
||
foreach (var c in q) | ||
Console.WriteLine(c.ContactName); | ||
} | ||
|
||
5. See more at https://github.com/linq2db/t4models | ||
*/ | ||
|
||
NamespaceName = "DataModels"; | ||
|
||
LoadSQLiteMetadata(@"C:\Data", "MyDatabase.sqlite"); | ||
// LoadSQLiteMetadata(string connectionString); | ||
|
||
GenerateModel(); | ||
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<#@ template language="C#" debug="True" hostSpecific="True" #> | ||
<#@ output extension=".generated.cs" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\LinqToDB.SqlServer.Tools.ttinclude" #> | ||
<#@ include file="$(SolutionDir).tools\linq2db.t4models\LinqToDB.Templates\PluralizationService.ttinclude" #> | ||
<# | ||
/* | ||
1. Copy this file to a folder where you would like to generate your data model, | ||
rename it, and delete .txt extension. For example: | ||
|
||
MyProject | ||
DataModels | ||
MyDatabase.tt | ||
|
||
2. Modify the connection settings below to connect to your database. | ||
|
||
3. Add connection string to the web/app.config file: | ||
|
||
<connectionStrings> | ||
<add name="MyDatabase" providerName="System.Data.SqlClient" | ||
connectionString="Data Source=.;Database=MyDatabase;User Id=User;Password=TestPassword;" /> | ||
</connectionStrings> | ||
|
||
4. To access your database use the following code: | ||
|
||
using (var db = new MyDatabaseDB()) | ||
{ | ||
var q = | ||
from c in db.Customers | ||
select c; | ||
|
||
foreach (var c in q) | ||
Console.WriteLine(c.ContactName); | ||
} | ||
|
||
5. See more at https://github.com/linq2db/t4models | ||
|
||
If you need to use the Microsoft.SqlServer.Types namespace, install the Microsoft.SqlServer.Types nuget, | ||
and replace the following include at the top of this file: | ||
|
||
"$(ProjectDir)LinqToDB.Templates\LinqToDB.SqlServer.Tools.ttinclude" | ||
|
||
with | ||
|
||
"$(ProjectDir)LinqToDB.Templates\LinqToDB.SqlServer.SqlTypes.Tools.ttinclude" | ||
*/ | ||
|
||
NamespaceName = "DataModels"; | ||
|
||
LoadSqlServerMetadata("MyServer", "MyDatabase", "User", "Password"); | ||
// LoadSqlServerMetadata(".", "MyDatabase"); // Integrated Security | ||
// LoadSqlServerMetadata(string connectionString); | ||
|
||
GenerateModel(); | ||
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
param($installPath, $toolsPath, $package) | ||
|
||
# get the active solution | ||
$solution = Get-Interface $dte.Solution ([EnvDTE80.Solution2]) | ||
$solutionPath = [System.IO.Path]::GetDirectoryName($solution.FullName) | ||
$linq2dbToolsPath = [System.IO.Path]::Combine($solutionPath, ".tools", "linq2db.t4models") | ||
$linq2dbContentPath = [System.IO.Path]::Combine($installPath, "content") | ||
|
||
# tools copy | ||
xcopy $("$toolsPath\*.*") $("$linq2dbToolsPath\") /y /e | ||
|
||
# content copy for .Net Core & similar projects | ||
xcopy $("$linq2dbContentPath\*.*") $("$linq2dbToolsPath\") /y /e | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.