DbHelper.cs 648 B

1234567891011121314151617181920212223242526
  1. using SqlSugar;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Configuration;
  5. namespace TFT_DbHelper
  6. {
  7. public static class DbHelper
  8. {
  9. public static SqlSugarScope Db = new(new ConnectionConfig()
  10. {
  11. ConnectionString = ConfigurationManager.AppSettings["MySql"],
  12. DbType = DbType.MySql,
  13. IsAutoCloseConnection = true,
  14. ConfigId = "TFT-AgvControlSystem"
  15. },
  16. db =>
  17. {
  18. //db.Aop.OnLogExecuting = (sql, pars) =>
  19. //{
  20. // Console.WriteLine(sql);//输出sql,查看执行sql 性能无影响
  21. //};
  22. });
  23. }
  24. }