Update demo

This commit is contained in:
sunkaixuan 2019-06-04 15:30:36 +08:00
parent 237a0d95dd
commit 15616575dc
20 changed files with 30 additions and 29 deletions

View File

@ -28,7 +28,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,//Master Connection
DbType = DbType.MySql,
DbType = DbType.Sqlite,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
SlaveConnectionConfigs = new List<SlaveConnectionConfig>() {
@ -53,7 +53,7 @@ namespace OrmTest
Console.WriteLine("#### SqlSugarClient Start ####");
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
@ -146,7 +146,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.MySql,
DbType = DbType.Sqlite,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute,
ConfigureExternalServices = new ConfigureExternalServices()
@ -209,7 +209,7 @@ namespace OrmTest
new ConnectionConfig()
{
ConfigId = 1,
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
@ -226,8 +226,8 @@ namespace OrmTest
Console.WriteLine("#### Distributed TransactionExample Start ####");
SqlSugarClient db = new SqlSugarClient(new List<ConnectionConfig>()
{
new ConnectionConfig(){ ConfigId="1", DbType=DbType.MySql, ConnectionString=Config.ConnectionString,InitKeyType=InitKeyType.Attribute,IsAutoCloseConnection=true },
new ConnectionConfig(){ ConfigId="2", DbType=DbType.MySql, ConnectionString=Config.ConnectionString2 ,InitKeyType=InitKeyType.Attribute ,IsAutoCloseConnection=true}
new ConnectionConfig(){ ConfigId="1", DbType=DbType.Sqlite, ConnectionString=Config.ConnectionString,InitKeyType=InitKeyType.Attribute,IsAutoCloseConnection=true },
new ConnectionConfig(){ ConfigId="2", DbType=DbType.Sqlite, ConnectionString=Config.ConnectionString2 ,InitKeyType=InitKeyType.Attribute ,IsAutoCloseConnection=true}
});
//use db1
@ -352,7 +352,7 @@ namespace OrmTest
Db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.MySql,
DbType = DbType.Sqlite,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute,
AopEvents = new AopEvents()
@ -386,7 +386,7 @@ namespace OrmTest
Db = new SqlSugarClient(new ConnectionConfig()
{
ConnectionString = Config.ConnectionString,
DbType = DbType.MySql,
DbType = DbType.Sqlite,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute,
AopEvents = new AopEvents()

View File

@ -323,7 +323,7 @@ namespace OrmTest
{
return new SqlSugarClient(new ConnectionConfig()
{
DbType = SqlSugar.DbType.MySql,
DbType = SqlSugar.DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
Console.WriteLine("#### SqlQueryable Start ####");
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true

View File

@ -14,7 +14,7 @@ namespace OrmTest
Console.WriteLine("#### DbFirst Start ####");
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true

View File

@ -14,7 +14,7 @@ namespace OrmTest
Console.WriteLine("#### CodeFirst Start ####");
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString3,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -16,7 +16,7 @@ namespace OrmTest
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -38,7 +38,7 @@ namespace OrmTest
public static SqlSugarClient GetInstance()
{
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.MySql, ConnectionString = Config.ConnectionString, IsAutoCloseConnection = true });
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { DbType = DbType.Sqlite, ConnectionString = Config.ConnectionString, IsAutoCloseConnection = true });
//single table query gobal filter
db.QueryFilter.Add(new SqlFilterItem()

View File

@ -38,6 +38,7 @@
<HintPath>OtherDll\SyntacticSugar.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />

View File

@ -10,7 +10,7 @@ namespace OrmTest
{
public static SqlSugarClient Db=> new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,

View File

@ -12,7 +12,7 @@ namespace OrmTest
public static SqlSugarClient simpleDb => new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
@ -27,7 +27,7 @@ namespace OrmTest
});
public static SqlSugarClient ssDb => new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
@ -43,7 +43,7 @@ namespace OrmTest
});
public static SqlSugarClient singleDb = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,
@ -58,7 +58,7 @@ namespace OrmTest
});
public static SqlSugarClient singleAndSsDb = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.Sqlite,
ConnectionString = Config.ConnectionString,
InitKeyType = InitKeyType.Attribute,
IsAutoCloseConnection = true,