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 | 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