Files
f9-web-ai-test/backend/F9WebAiTest.Infrastructure/FreeSqls/Repositories/F9RepositoryBase.cs
T
2026-10-08 10:43:59 +08:00

16 lines
517 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using FreeSql;
using F9WebAiTest.Infrastructure.FreeSqls.Persistence;
namespace F9WebAiTest.Infrastructure.FreeSqls.Repositories;
/// <summary>F9 风格仓储基类:提供事务感知的 Orm(事务内用事务 Orm,事务外用外部 Orm)</summary>
public abstract class F9RepositoryBase
{
protected readonly IFreeSql _fsql;
protected F9RepositoryBase(IFreeSql fsql) => _fsql = fsql;
/// <summary>事务感知的 Orm</summary>
protected IFreeSql Orm => UnitOfWork_F9.CurrentOrm ?? _fsql;
}