mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
Add json 2 sql test
This commit is contained in:
51
Src/Asp.NetCore2/Json2Sql/Program.cs
Normal file
51
Src/Asp.NetCore2/Json2Sql/Program.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
partial class Program
|
||||
{
|
||||
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,
|
||||
IsAutoCloseConnection = true,
|
||||
ConnectionString = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql"
|
||||
}); ;
|
||||
jsonToSqlClient.Context.Aop.OnLogExecuted = (sql, p) =>
|
||||
{
|
||||
Console.WriteLine(sql);
|
||||
};
|
||||
|
||||
Insetable01(jsonToSqlClient);
|
||||
|
||||
Description(jsonToSqlClient);
|
||||
FuncText(jsonToSqlClient);
|
||||
OrderByTest(jsonToSqlClient);
|
||||
GroupByTest(jsonToSqlClient);
|
||||
SelectTest(jsonToSqlClient);
|
||||
JoinTest(jsonToSqlClient);
|
||||
WhereTest(jsonToSqlClient);
|
||||
PageTest(jsonToSqlClient);
|
||||
PageTest2(jsonToSqlClient);
|
||||
PageTest3(jsonToSqlClient);
|
||||
|
||||
Updateable01(jsonToSqlClient);
|
||||
Deleteable01(jsonToSqlClient);
|
||||
|
||||
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user