Skip to content

Commit

Permalink
v1.8.1 - 更新 FreeSql 依赖至 3.2.806;
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Dec 18, 2023
1 parent f020d4c commit c1a0874
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
4 changes: 2 additions & 2 deletions examples/net40_tcc_saga/net40_tcc_saga.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FreeSql">
<Version>3.2.666</Version>
<Version>3.2.806</Version>
</PackageReference>
<PackageReference Include="FreeSql.Provider.Sqlite">
<Version>3.2.666</Version>
<Version>3.2.806</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion examples/net60_tcc_saga/net60_tcc_saga.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.666" />
<PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.806" />
</ItemGroup>

<ItemGroup>
Expand Down
10 changes: 5 additions & 5 deletions examples/net60_webapi/net60_webapi.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
Expand All @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FreeSql.DbContext" Version="3.2.666" />
<PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.666" />
<PackageReference Include="FreeSql.Provider.PostgreSQL" Version="3.2.666" />
<PackageReference Include="FreeSql.Provider.Oracle" Version="3.2.666" />
<PackageReference Include="FreeSql.DbContext" Version="3.2.806" />
<PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.806" />
<PackageReference Include="FreeSql.Provider.PostgreSQL" Version="3.2.806" />
<PackageReference Include="FreeSql.Provider.Oracle" Version="3.2.806" />
<PackageReference Include="Rougamo.Fody" Version="1.1.2" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion examples/netcore31_tcc_saga/netcore31_tcc_saga.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.666" />
<PackageReference Include="FreeSql.Provider.Sqlite" Version="3.2.806" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/FreeSql.Cloud/FreeSql.Cloud.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>netstandard20;net40</TargetFrameworks>
<Version>1.6.12</Version>
<Version>1.8.1</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>FreeSql;ncc;YeXiangQin</Authors>
<Description>提供跨数据库访问,分布式事务TCC、SAGA解决方案,支持 .NET Core 2.1+, .NET Framework 4.0+.</Description>
Expand All @@ -26,7 +26,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="FreeSql.DbContext" Version="3.2.666" />
<PackageReference Include="FreeSql.DbContext" Version="3.2.806" />
<PackageReference Include="FreeScheduler" Version="1.1.0" />
<PackageReference Include="IdleBus" Version="1.5.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
4 changes: 3 additions & 1 deletion src/FreeSql.Cloud/FreeSqlCloud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ public FreeSqlCloud<TDBKey> Register(TDBKey dbkey, Func<IFreeSql> create, TimeSp
if (!string.IsNullOrWhiteSpace(DistributeKey))
{
if (_distributeTraceEnable) _distributedTraceCall($"{dbkey} 注册成功, 并存储 TCC/SAGA 事务相关数据");
_scheduler = new FreeScheduler.Scheduler(new FreeScheduler.TaskHandlers.TestHandler());
_scheduler = new FreeSchedulerBuilder()
.OnExecuting(task => { })
.Build();

_ormMaster.Aop.ConfigEntity += (_, e) =>
{
Expand Down
22 changes: 15 additions & 7 deletions src/FreeSql.Cloud/RepositoryCloud/RepositoryCloud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected IBaseRepository<TEntity> CurrentRepository
{
repo.DbContextOptions = _firstRepository.DbContextOptions;
if (_asTypeEntityType != null) repo.AsType(_asTypeEntityType);
if (_asTableRule != null) repo.AsTable(_asTableRule);
if (_asTablePriv != null) repo.AsTable(_asTablePriv);
}
}
return repo;
Expand All @@ -90,14 +90,22 @@ public void AsType(Type entityType)
{
_asTypeEntityType = entityType;
ForEachRepos(repo => repo.AsType(entityType));
}
Func<string, string> _asTableRule;
public void AsTable(Func<string, string> rule)
}
internal Func<Type, string, string> _asTablePriv;
public void AsTable(Func<string, string> rule)
{
_asTableRule = rule;
ForEachRepos(repo => repo.AsTable(rule));
if (rule == null)
_asTablePriv = null;
else
_asTablePriv = (a, b) => a == EntityType ? rule(b) : null;
ForEachRepos(repo => repo.AsTable(_asTablePriv));
}
public IUnitOfWork UnitOfWork
public void AsTable(Func<Type, string, string> rule)
{
_asTablePriv = rule;
ForEachRepos(repo => repo.AsTable(_asTablePriv));
}
public IUnitOfWork UnitOfWork
{
get => CurrentRepository.UnitOfWork;
set => CurrentRepository.UnitOfWork = value;
Expand Down

0 comments on commit c1a0874

Please sign in to comment.