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.
24 lines
700 B
24 lines
700 B
7 years ago
|
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.Sqlite, IsAutoCloseConnection = true });
|
||
|
db.Ado.IsEnableLogEvent = true;
|
||
|
db.Ado.LogEventStarting = (sql, pars) =>
|
||
|
{
|
||
|
Console.WriteLine(sql + "\r\n" + db.RewritableMethods.SerializeObject(pars));
|
||
|
Console.WriteLine();
|
||
|
};
|
||
|
return db;
|
||
|
}
|
||
|
}
|
||
|
}
|