Update demo

This commit is contained in:
sunkaixuan
2019-06-02 16:38:16 +08:00
parent 0c13d2413b
commit eca4986054
5 changed files with 105 additions and 5 deletions

View File

@@ -1,4 +1,5 @@
using System;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -10,7 +11,26 @@ namespace OrmTest
{
public static void Init()
{
Console.WriteLine("");
Console.WriteLine("#### DbMain Start ####");
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)));
}
}
});
Console.WriteLine("#### DbMain End ####");
}
}
}