25 lines
641 B
C#
25 lines
641 B
C#
using System;
|
|
using System.Configuration;
|
|
using SqlSugar;
|
|
|
|
namespace DM_Weight.util
|
|
{
|
|
public class SqlSugarHelper
|
|
{
|
|
public static SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig()
|
|
{
|
|
|
|
ConnectionString = ConfigurationManager.ConnectionStrings["database"].ToString(),
|
|
DbType = DbType.MySql,
|
|
IsAutoCloseConnection = true
|
|
},
|
|
db =>
|
|
{
|
|
db.Aop.OnLogExecuting = (sql, pars) =>
|
|
{
|
|
Console.WriteLine(sql);
|
|
};
|
|
}
|
|
);
|
|
}
|
|
} |