SqlSugar/Src/Asp.Net/PgSqlTest/UnitTest/Main.cs

53 lines
1.4 KiB
C#
Raw Normal View History

2019-05-26 19:35:57 +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.PostgreSQL,
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 15:23:17 +08:00
public static void RestData()
{
Db.DbMaintenance.TruncateTable<Order>();
Db.DbMaintenance.TruncateTable<OrderItem>();
}
2019-05-26 19:35:57 +08:00
public static void Init()
{
2022-04-30 17:35:01 +08:00
UCustom08.Init();
2022-04-13 22:41:33 +08:00
UCustom012.Init();
UCustom014.Init();
UCustom015.Init();
2022-03-24 18:49:51 +08:00
UCustom011.Init();
2022-03-02 14:55:38 +08:00
UCustom01.Init();
2019-06-10 10:28:28 +08:00
Save();
2019-05-26 19:35:57 +08:00
CodeFirst();
Updateable();
Json();
Ado();
Queryable();
QueryableAsync();
2021-01-29 20:36:52 +08:00
//Thread();
//Thread2();
//Thread3();
2019-05-26 19:35:57 +08:00
}
}
}