123456789101112131415161718192021222324252627282930313233343536 |
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace B20UVLog
- {
- public class DbHelper
- {
- private static string comConfig = ConfigurationManager.AppSettings["MySql"];
- public static SqlSugarScope Db = new(new ConnectionConfig()
- {
- ConnectionString = comConfig,
- DbType = DbType.MySql,
- IsAutoCloseConnection = true,
- ConfigId = "LogPcDb"
- },
- db =>
- {
- // db.DbFirst.IsCreateAttribute()
- //.CreateClassFile(@"E:\", "B20UVLog.Models");
- // db.Aop.OnLogExecuting = (sql, pars) =>
- // {
- // Console.WriteLine(sql);//输出sql,查看执行sql 性能无影响
- // };
- }
- );
- }
- }
|