update demo

This commit is contained in:
sunkaixuan 2023-11-14 12:17:57 +08:00
parent e991dd337b
commit d8c8f89744
2 changed files with 17 additions and 10 deletions

View File

@ -9,18 +9,18 @@ namespace Test
static void Main(string[] args)
{
JsonClient jsonToSqlClient = new JsonClient();
//jsonToSqlClient.Context = new SqlSugarClient(new ConnectionConfig()
//{
// DbType = DbType.SqlServer,
// IsAutoCloseConnection = true,
// ConnectionString = "server=.;uid=sa;pwd=sasa;database=SQLSUGAR4XTEST"
//});
jsonToSqlClient.Context = new SqlSugarClient(new ConnectionConfig()
{
DbType = DbType.MySql,
DbType = DbType.SqlServer,
IsAutoCloseConnection = true,
ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql"
}); ;
ConnectionString = "server=.;uid=sa;pwd=sasa;database=SQLSUGAR4XTEST"
});
//jsonToSqlClient.Context = new SqlSugarClient(new ConnectionConfig()
//{
// DbType = DbType.MySql,
// IsAutoCloseConnection = true,
// ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql"
//}); ;
TestHelper.InitDatabase(jsonToSqlClient);
jsonToSqlClient.Context.Aop.OnLogExecuted = (sql, p) =>

View File

@ -54,10 +54,17 @@ namespace Test
]
}
";
var x2 = jsonToSqlClient.Queryable(json2).ToSqlList();
var x2 = jsonToSqlClient.Queryable(json2).ToSqlList();
var json3 = @"{
""Table"":""order"",
""Where"":[ ""name"",""="", ""{string}:U"" ],
""Select"":[ ""{string}:abc"",""name"" ]
}";
var x3=jsonToSqlClient.Queryable(json3).ToSqlList();
var list1 = jsonToSqlClient.Context.Ado.SqlQuery<dynamic>(x1[0].Sql, x1[0].Parameters);
var list2 = jsonToSqlClient.Context.Ado.SqlQuery<dynamic>(x2[0].Sql, x2[0].Parameters);
var list3 = jsonToSqlClient.Context.Ado.SqlQuery<dynamic>(x3[0].Sql, x3[0].Parameters);
}
private static void JoinTest(JsonClient jsonToSqlClient)
{