-
Notifications
You must be signed in to change notification settings - Fork 59
/
CopyMe.MySql.tt.txt
39 lines (30 loc) · 1.24 KB
/
CopyMe.MySql.tt.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<#@ template language="C#" debug="True" hostSpecific="True" #>
<#@ output extension=".generated.cs" #>
<#@ include file="$(ProjectDir)LinqToDB.Templates\LinqToDB.MySql.Tools.ttinclude" #>
<#@ include file="$(ProjectDir)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);
}
*/
NamespaceName = "DataModel";
LoadMySqlMetadata("MyServer", "MyDatabase", "root", "TestPassword");
GenerateModel();
#>