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

33 lines
865 B
C#
Raw Normal View History

2019-05-16 20:25:11 +08:00
using SqlSugar;
using System;
2019-05-07 09:12:38 +08:00
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OrmTest
{
public partial class NewUnitTest
{
2019-05-16 20:25:11 +08:00
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);
2019-05-16 22:16:55 +08:00
Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
2019-05-16 20:25:11 +08:00
}
}
});
2019-05-07 09:12:38 +08:00
public static void Init()
{
2019-05-16 20:25:11 +08:00
Json();
2019-05-18 10:55:28 +08:00
Thread();
2019-05-07 09:12:38 +08:00
}
}
}