From 479b6cfc60113f692f6f9146bcd7b9231a32b0e8 Mon Sep 17 00:00:00 2001 From: 移动系统liao <liaoxujun@qq.com> Date: 星期六, 08 二月 2025 09:07:57 +0800 Subject: [PATCH] Merge branch 'cyronghe' --- cylsg/cylsg.Core/DbContext.cs | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/cylsg/cylsg.Core/DbContext.cs b/cylsg/cylsg.Core/DbContext.cs index 004a656..cc2b67c 100644 --- a/cylsg/cylsg.Core/DbContext.cs +++ b/cylsg/cylsg.Core/DbContext.cs @@ -9,12 +9,28 @@ /// </summary> public static class DbContext { + public static List<ConnectionConfig> connectionConfigs + { + get + { + var list = App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs"); + foreach (var config in list) + { + config.ConfigureExternalServices = new ConfigureExternalServices() + { + DataInfoCacheService = new SqlSugarRedisCache() + }; + } + return list; + } + } /// <summary> /// SqlSugar 鏁版嵁搴撳疄渚� /// </summary> public static readonly SqlSugarScope Instance = new( // 璇诲彇 appsettings.json 涓殑 ConnectionConfigs 閰嶇疆鑺傜偣 - App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs") + //App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs") + connectionConfigs , db => { // 杩欓噷閰嶇疆鍏ㄥ眬浜嬩欢锛屾瘮濡傛嫤鎴墽琛� SQL -- Gitblit v1.9.1