2017-08-24 16:07:41 +08:00
|
|
|
|
using SqlSugar;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace OrmTest.Demo
|
|
|
|
|
{
|
|
|
|
|
public class DemoBase
|
|
|
|
|
{
|
|
|
|
|
public static SqlSugarClient GetInstance()
|
|
|
|
|
{
|
|
|
|
|
SqlSugarClient db = new SqlSugarClient(new ConnectionConfig() { ConnectionString = Config.ConnectionString, DbType = DbType.MySql, IsAutoCloseConnection = true });
|
|
|
|
|
db.Ado.IsEnableLogEvent = true;
|
|
|
|
|
db.Ado.LogEventStarting = (sql, pars) =>
|
|
|
|
|
{
|
2017-09-20 14:00:49 +08:00
|
|
|
|
Console.WriteLine(sql + "\r\n" + pars);
|
2017-08-24 16:07:41 +08:00
|
|
|
|
Console.WriteLine();
|
|
|
|
|
};
|
|
|
|
|
return db;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|