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 | 19 ++++++++++++++++++- 1 files changed, 18 insertions(+), 1 deletions(-) diff --git a/cylsg/cylsg.Core/DbContext.cs b/cylsg/cylsg.Core/DbContext.cs index 324ec72..cc2b67c 100644 --- a/cylsg/cylsg.Core/DbContext.cs +++ b/cylsg/cylsg.Core/DbContext.cs @@ -9,14 +9,31 @@ /// </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 + var a = 100; }); } -- Gitblit v1.9.1