2019-05-17 22:26:30 +08:00
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace OrmTest
|
|
|
|
|
{
|
|
|
|
|
public partial class NewUnitTest
|
|
|
|
|
{
|
|
|
|
|
public static SqlSugarClient Db=> new SqlSugarClient(new ConnectionConfig()
|
|
|
|
|
{
|
|
|
|
|
DbType = DbType.SqlServer,
|
|
|
|
|
ConnectionString = Config.ConnectionString,
|
|
|
|
|
InitKeyType = InitKeyType.Attribute,
|
|
|
|
|
IsAutoCloseConnection = true,
|
|
|
|
|
AopEvents = new AopEvents
|
|
|
|
|
{
|
|
|
|
|
OnLogExecuting = (sql, p) =>
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(sql);
|
|
|
|
|
Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2019-06-04 21:03:27 +08:00
|
|
|
|
|
|
|
|
|
public static void RestData()
|
|
|
|
|
{
|
|
|
|
|
Db.DbMaintenance.TruncateTable<Order>();
|
|
|
|
|
Db.DbMaintenance.TruncateTable<OrderItem>();
|
|
|
|
|
}
|
2019-05-17 22:26:30 +08:00
|
|
|
|
public static void Init()
|
|
|
|
|
{
|
2022-04-13 23:01:54 +08:00
|
|
|
|
UCustom015.Init();
|
|
|
|
|
UCustom014.Init();
|
2022-04-10 02:34:26 +08:00
|
|
|
|
UCustom012.Init();
|
2021-12-26 02:05:48 +08:00
|
|
|
|
UCustom01.Init();
|
|
|
|
|
UCustom02.Init();
|
|
|
|
|
UCustom03.Init();
|
2021-11-21 12:28:10 +08:00
|
|
|
|
Bulk();
|
2021-01-31 18:54:56 +08:00
|
|
|
|
Filter();
|
2021-01-18 00:54:51 +08:00
|
|
|
|
Insert();
|
2021-01-31 18:54:56 +08:00
|
|
|
|
Enum();
|
|
|
|
|
Tran();
|
2020-11-15 00:39:23 +08:00
|
|
|
|
Queue();
|
2019-06-04 21:03:27 +08:00
|
|
|
|
CodeFirst();
|
2019-05-21 12:57:51 +08:00
|
|
|
|
Updateable();
|
2019-05-17 22:26:30 +08:00
|
|
|
|
Json();
|
2019-05-21 12:57:51 +08:00
|
|
|
|
Ado();
|
|
|
|
|
Queryable();
|
2021-01-18 00:54:51 +08:00
|
|
|
|
Queryable2();
|
2019-05-21 12:57:51 +08:00
|
|
|
|
QueryableAsync();
|
2020-11-15 00:39:23 +08:00
|
|
|
|
//Thread();
|
|
|
|
|
//Thread2();
|
|
|
|
|
//Thread3();
|
2019-05-17 22:26:30 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|