From 1cb49b04ae6709e6054c328f5ed12bff9ca014c8 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期二, 12 十一月 2024 09:21:57 +0800
Subject: [PATCH] no message
---
CoreCms.Net.Core/Config/SqlSugarSetup.cs | 29 ++++++++++++++++++++++++-----
1 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/CoreCms.Net.Core/Config/SqlSugarSetup.cs b/CoreCms.Net.Core/Config/SqlSugarSetup.cs
index 147521e..fa42781 100644
--- a/CoreCms.Net.Core/Config/SqlSugarSetup.cs
+++ b/CoreCms.Net.Core/Config/SqlSugarSetup.cs
@@ -1,6 +1,6 @@
锘�/***********************************************************************
- * Project: CoreCms.Net *
- * Web: https://CoreCms.Net *
+ * Project: baifenBinfa.Net *
+ * Web: https://baifenBinfa.com *
* ProjectName: 鐧惧垎鍏垫硶绠$悊绯荤粺 *
* Author: *
* Email: *
@@ -12,6 +12,7 @@
using System;
+using System.Collections.Generic;
using CoreCms.Net.Caching.SqlSugar;
using CoreCms.Net.Configuration;
using CoreCms.Net.Loging;
@@ -32,16 +33,34 @@
if (services == null) throw new ArgumentNullException(nameof(services));
//娉ㄥ叆 ORM
- SugarIocServices.AddSqlSugar(new IocConfig()
+ //SugarIocServices.AddSqlSugar(new IocConfig()
+ //{
+ // //鏁版嵁搴撹繛鎺�
+ // ConnectionString = AppSettingsConstVars.DbSqlConnection,
+ // //鍒ゆ柇鏁版嵁搴撶被鍨�
+ // DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer,
+ // //鏄惁寮�鍚嚜鍔ㄥ叧闂暟鎹簱杩炴帴
+ // IsAutoCloseConnection = true
+ //});
+ SugarIocServices.AddSqlSugar(new List<IocConfig>
{
- //鏁版嵁搴撹繛鎺�
+ new IocConfig{//鏁版嵁搴撹繛鎺�
ConnectionString = AppSettingsConstVars.DbSqlConnection,
//鍒ゆ柇鏁版嵁搴撶被鍨�
DbType = AppSettingsConstVars.DbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer,
//鏄惁寮�鍚嚜鍔ㄥ叧闂暟鎹簱杩炴帴
IsAutoCloseConnection = true
- });
+ },
+ new IocConfig
+ {
+ ConfigId=AppSettingsConstVars.CYDbDbID,
+ ConnectionString=AppSettingsConstVars.CyDbSqlConnection,
+ DbType = AppSettingsConstVars.CyDbDbType == IocDbType.MySql.ToString() ? IocDbType.MySql : IocDbType.SqlServer,
+ //鏄惁寮�鍚嚜鍔ㄥ叧闂暟鎹簱杩炴帴
+ IsAutoCloseConnection = true
+ }
+ });
//璁剧疆鍙傛暟
services.ConfigurationSugar(db =>
{
--
Gitblit v1.9.1