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()
|
|
|
|
|
{
|
2023-07-10 17:11:51 +08:00
|
|
|
|
UnitOneToOneNAny.Init();
|
2023-07-04 15:32:44 +08:00
|
|
|
|
Unitrasdfa.Init();
|
2023-06-28 17:21:30 +08:00
|
|
|
|
Unitadfasdfa.Init();
|
2023-06-26 18:32:39 +08:00
|
|
|
|
UpdateNavOneToOne.Init();
|
2023-05-28 19:30:40 +08:00
|
|
|
|
Unitasf1.Init();
|
2023-05-05 10:56:27 +08:00
|
|
|
|
UOneManyMany7.init();
|
2023-05-04 23:33:47 +08:00
|
|
|
|
UOneManyMany6.init();
|
2023-04-25 11:44:39 +08:00
|
|
|
|
UinitCustomConvert.Init();
|
2023-04-18 17:22:06 +08:00
|
|
|
|
UnitCustom020.Init();
|
2022-12-03 22:48:45 +08:00
|
|
|
|
UnitSubToList.Init();
|
2022-09-21 18:27:00 +08:00
|
|
|
|
UJsonsdafa.Init();
|
2022-07-03 01:20:29 +08:00
|
|
|
|
UOneManyMany.init();
|
2022-07-03 17:12:52 +08:00
|
|
|
|
UOneManyMany2.init();
|
|
|
|
|
UOneManyMany3.init();
|
|
|
|
|
UOneManyMany4.init();
|
2022-07-04 08:04:59 +08:00
|
|
|
|
UOneManyMany5.init();
|
2022-06-27 22:20:36 +08:00
|
|
|
|
UNavDynamic111N.Init();
|
2022-05-07 13:42:06 +08:00
|
|
|
|
UCustom019.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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|