From a247547df86f0fad8f03aebb91de68d3f2bc7918 Mon Sep 17 00:00:00 2001 From: 移动系统liao <liaoxujun@qq.com> Date: 星期四, 01 五月 2025 10:16:52 +0800 Subject: [PATCH] 修正sugsql导航更新加配置的bug --- 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