mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-25 21:22:55 +08:00
Update Demo
This commit is contained in:
@@ -10,7 +10,7 @@ namespace OrmTest
|
||||
{
|
||||
public static SqlSugarClient Db=> new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
DbType = DbType.MySql,
|
||||
ConnectionString = Config.ConnectionString,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
@@ -48,9 +48,9 @@ namespace OrmTest
|
||||
task8.Wait();
|
||||
UValidate.Check(8, task8.Result[0].id, "ado");
|
||||
|
||||
var task9=Db.Ado.SqlQuery<Order, OrderItem>("select * from [order];select * from OrderDetail");
|
||||
var task9=Db.Ado.SqlQuery<Order, OrderItem>("select * from `order`;select * from OrderDetail");
|
||||
|
||||
var task10 = Db.Ado.SqlQueryAsync<Order, OrderItem>("select * from [order];select * from OrderDetail");
|
||||
var task10 = Db.Ado.SqlQueryAsync<Order, OrderItem>("select * from `order`;select * from OrderDetail");
|
||||
task10.Wait();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ namespace OrmTest
|
||||
[Dc]=@Dc,[IntNull]=@IntNull WHERE [Int]=@Int", "Queryable");
|
||||
|
||||
sql = Db.Queryable<Order>().IgnoreColumns(it => it.CreateTime).ToSql().Key;
|
||||
UValidate.Check(sql, "SELECT [Id],[Name],[Price],[CustomId] FROM [Order] ", "Queryable");
|
||||
UValidate.Check(sql, "SELECT [Id],[Name],[Price],[CustomId] FROM `order` ", "Queryable");
|
||||
sql = Db.Queryable<Order>().IgnoreColumns(it => new { it.Id, it.Name }).ToSql().Key;
|
||||
UValidate.Check(sql, "SELECT [Price],[CreateTime],[CustomId] FROM [Order] ", "Queryable");
|
||||
UValidate.Check(sql, "SELECT [Price],[CreateTime],[CustomId] FROM `order` ", "Queryable");
|
||||
sql = Db.Queryable<Order>().IgnoreColumns("id").ToSql().Key;
|
||||
UValidate.Check(sql, "SELECT [Name],[Price],[CreateTime],[CustomId] FROM [Order] ", "Queryable");
|
||||
UValidate.Check(sql, "SELECT [Name],[Price],[CreateTime],[CustomId] FROM `order` ", "Queryable");
|
||||
|
||||
var cts = IEnumerbleContains.Data();
|
||||
var list2=Db.Queryable<Order>()
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace OrmTest
|
||||
|
||||
public static SqlSugarClient simpleDb => new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
DbType = DbType.MySql,
|
||||
ConnectionString = Config.ConnectionString,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
@@ -27,7 +27,7 @@ namespace OrmTest
|
||||
});
|
||||
public static SqlSugarClient ssDb => new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
DbType = DbType.MySql,
|
||||
ConnectionString = Config.ConnectionString,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
@@ -43,7 +43,7 @@ namespace OrmTest
|
||||
});
|
||||
public static SqlSugarClient singleDb = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
DbType = DbType.MySql,
|
||||
ConnectionString = Config.ConnectionString,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
@@ -58,7 +58,7 @@ namespace OrmTest
|
||||
});
|
||||
public static SqlSugarClient singleAndSsDb = new SqlSugarClient(new ConnectionConfig()
|
||||
{
|
||||
DbType = DbType.SqlServer,
|
||||
DbType = DbType.MySql,
|
||||
ConnectionString = Config.ConnectionString,
|
||||
InitKeyType = InitKeyType.Attribute,
|
||||
IsAutoCloseConnection = true,
|
||||
|
||||
Reference in New Issue
Block a user