2019-06-04 21:15:23 +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.MySql,
|
|
|
|
|
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)));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
public static void RestData()
|
|
|
|
|
{
|
|
|
|
|
Db.DbMaintenance.TruncateTable<Order>();
|
|
|
|
|
Db.DbMaintenance.TruncateTable<OrderItem>();
|
|
|
|
|
}
|
|
|
|
|
public static void Init()
|
|
|
|
|
{
|
2024-02-18 17:25:48 +08:00
|
|
|
|
UnitWeek.Init();
|
2024-02-06 23:15:26 +08:00
|
|
|
|
UnitTest.Init();
|
2023-11-14 11:24:31 +08:00
|
|
|
|
Unitdfasfasfa.Init();
|
2023-11-03 17:28:56 +08:00
|
|
|
|
UnitAddRemark.Init();
|
2023-10-16 12:32:24 +08:00
|
|
|
|
UnitSplitTask.Init();
|
2023-10-04 20:36:13 +08:00
|
|
|
|
UnitBulkMerge.Init();
|
2023-09-09 13:01:11 +08:00
|
|
|
|
UnitUpdateNavOneToOneFalse.Init();
|
2023-04-14 18:57:52 +08:00
|
|
|
|
UnitCreateType.Init();
|
2022-12-04 00:20:52 +08:00
|
|
|
|
UnitSubToList.Init();
|
2021-11-21 12:33:22 +08:00
|
|
|
|
Bulk();
|
2019-06-04 21:15:23 +08:00
|
|
|
|
CodeFirst();
|
|
|
|
|
Updateable();
|
|
|
|
|
Json();
|
|
|
|
|
Ado();
|
|
|
|
|
Queryable();
|
|
|
|
|
QueryableAsync();
|
|
|
|
|
Thread();
|
|
|
|
|
Thread2();
|
|
|
|
|
Thread3();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|