1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
| using Furion;
| using SqlSugar;
| using System.Collections.Generic;
|
| namespace cylsg.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
| });
| }
|
|