From 94da0698c01915b1e340415e080aa03050700d97 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期二, 15 十月 2024 17:04:56 +0800
Subject: [PATCH] 增加川印的模型
---
CoreCms.Net.Core/Config/SqlSugarSetup.cs | 25 ++++++++++++++++++++++---
1 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/CoreCms.Net.Core/Config/SqlSugarSetup.cs b/CoreCms.Net.Core/Config/SqlSugarSetup.cs
index cd40f8c..fa42781 100644
--- a/CoreCms.Net.Core/Config/SqlSugarSetup.cs
+++ b/CoreCms.Net.Core/Config/SqlSugarSetup.cs
@@ -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