From 5856a6e5de198436bc112923609db21c9a45fd10 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期二, 01 七月 2025 15:58:42 +0800
Subject: [PATCH] 增加公司收藏工人的功能
---
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