26 lines
		
	
	
		
			606 B
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			606 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);
 | 
						|
                };
 | 
						|
            }
 | 
						|
            );
 | 
						|
 | 
						|
    }
 | 
						|
} |