123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using SqlSugar;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Uninpho.DBOperation
- {
-
-
-
-
- public class Config
- {
-
-
-
- public static bool zdhjc = true;
- public static SqlSugarClient GetPgClient()
- {
- return new SqlSugarClient(new ConnectionConfig()
- {
- DbType = DbType.PostgreSQL,
- ConnectionString = System.Configuration.ConfigurationManager.AppSettings["dbConnection"] as string,
- InitKeyType = InitKeyType.Attribute,
- IsAutoCloseConnection = true,
- AopEvents = new AopEvents
- {
- OnLogExecuting = (sql, p) =>
- {
- if (zdhjc)
- {
- Console.WriteLine(sql);
- Console.WriteLine(string.Join(",", p?.Select(it => it.ParameterName + ":" + it.Value)));
- }
- }
- }
- });
- }
- }
- }
|