移动系统liao
2025-01-26 950f32a006736bd9407bb5f73b744892b8bade2a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Furion;
using SqlSugar;
using System.Collections.Generic;
 
namespace CYZuoYeBenPeiSong.Core;
 
/// <summary>
/// 数据库上下文对象
/// </summary>
public static class DbContext
{
    /// <summary>
    /// SqlSugar 数据库实例
    /// </summary>
    public static readonly SqlSugarScope Instance = new(
        // 读取 appsettings.json 中的 ConnectionConfigs 配置节点
        App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs")
        , db =>
        {
            // 这里配置全局事件,比如拦截执行 SQL
            var a = 1;
        });
}