z8018
2026-02-11 b8fb68b44c29e4667f6ea5746119413809a60a9e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using KH.WMS.Core.Database.Repositories;
using SqlSugar;
 
namespace KH.WMS.Core.Database;
 
/// <summary>
/// 数据库上下文接口
/// </summary>
public interface IDbContext : IDisposable
{
    /// <summary>
    /// 数据库操作对象
    /// </summary>
    ISqlSugarClient Db { get; }
 
    /// <summary>
    /// 开始事务
    /// </summary>
    Task BeginTransactionAsync(System.Data.IsolationLevel isolationLevel = System.Data.IsolationLevel.ReadCommitted);
 
    /// <summary>
    /// 提交事务
    /// </summary>
    Task CommitTransactionAsync();
 
    /// <summary>
    /// 回滚事务
    /// </summary>
    Task RollbackTransactionAsync();
 
    /// <summary>
    /// 获取当前事务隔离级别
    /// </summary>
    System.Data.IsolationLevel? CurrentIsolationLevel { get; }
 
    /// <summary>
    /// 获取仓储
    /// </summary>
    IRepository<T, TKey> GetRepository<T, TKey>()
        where T : class
        where TKey : struct;
}