SqlSugar源码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
3.6 KiB

6 years ago
using SqlSugar;
using System;
6 years ago
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OrmTest
{
public partial class NewUnitTest
{
6 years ago
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);
6 years ago
Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
6 years ago
}
}
});
6 years ago
public static void RestData()
{
Db.DbMaintenance.TruncateTable<Order>();
Db.DbMaintenance.TruncateTable<OrderItem>();
}
6 years ago
public static void Init()
{
2 years ago
UnitInsertNavOneToOne.Init();
2 years ago
CrossDatabase01.Init();
CrossDatabase02.Init();
CrossDatabase03.Init();
2 years ago
UInsertNav0adsf.Init();
2 years ago
UExp.Init();
2 years ago
USelectSinleDTO.Init();
2 years ago
UCustom024.Init();
2 years ago
UCustom24.Init();
2 years ago
UCustom20.Init();
2 years ago
UTran2.Init();
2 years ago
UnitUpdateSubQuery.Init();
2 years ago
UnitManyToManyDeleteNav.Init();
UnitTestReturnPkList.Init();
2 years ago
UnitCustom12312.Init();
2 years ago
UnitEnum22.Init();
2 years ago
UCustom025.Init();
UnitTestConfigQuery.Init();
UnitSub.Init();
UnitUpdateNavN3.Init();
UnitOneToOne12.Init();
UnitInsertNav3.Init();
UnitInsertNav2.Init();
UnitInsertNav.Init();
UnitInsertNav.Init();
UnitSelectN.Init();
UnitOneToOneN2.Init();
UnitManyToManyUpdate.Init();
UnitManyToMay1231.Init();
UnitUpdateNav2.Init();
UnitUpdateNav.Init();
UnitOneToOneN.Init();
ULock.Init();
UnitManyToMany2.Init();
UOneManyMany5.init();
UOneManyMany4.init();
UOneManyMany3.init();
UOneManyMany2.init();
UOneManyMany.init();
UNavDynamic111N.Init();
UCustomNavigate01.Init();
UCustom023.Init();
UCustom22.Init();
UByteArray.Init();
UCustom021.Inti();
UCustom020.Init();
UCustom019.Init();
UnitManyToMany.Init();
UCustom018.Init();
UCustom017.Init();
UCustom016.Init();
UCustom015.Init();
UCustom014.Init();
UCustom013.Init();
UCustom012.Init();
UintDynamic.Init();
UCustom09.Init();
UCustom011.Init();
UCustom010.Init();
UCustom08.Init();
UCustom07.Init();
UCustom01.Init();
UCustom02.Init();
UCustom03.Init();
UCustom04.Init();
UCustom05.Init();
UCustom06.Init();
SubQueryTest();
UConfig();
DeleteTest();
Fastest2();
SplitTest();
Filter();
Insert();
Insert2();
Enum();
Tran();
Queue();
CodeFirst();
6 years ago
Updateable();
6 years ago
Json();
6 years ago
Ado();
6 years ago
Queryable();
Queryable2();
6 years ago
QueryableAsync();
3 years ago
AopTest();
//Thread();
//Thread2();
//Thread3();
6 years ago
}
}
}