修复事务

This commit is contained in:
xuejiaming 2022-10-24 22:25:54 +08:00
parent 9f26b1947f
commit 89551d77dd
1 changed files with 8 additions and 0 deletions

View File

@ -32,6 +32,10 @@ namespace ShardingCore.EFCores
{
_shardingDbContext =
shardingDbContext ?? throw new ShardingCoreInvalidOperationException($"should implement {nameof(IShardingDbContext)}");
_shardingDbContextExecutor = shardingDbContext.GetShardingExecutor() ??
throw new ShardingCoreInvalidOperationException(
$"{shardingDbContext.GetType()} cant get {nameof(IShardingDbContextExecutor)} from {nameof(shardingDbContext.GetShardingExecutor)}");
}
#endif
@ -55,6 +59,10 @@ namespace ShardingCore.EFCores
{
_shardingDbContext =
shardingDbContext??throw new ShardingCoreInvalidOperationException($"should implement {nameof(IShardingDbContext)}");
_shardingDbContextExecutor = shardingDbContext.GetShardingExecutor() ??
throw new ShardingCoreInvalidOperationException(
$"{shardingDbContext.GetType()} cant get {nameof(IShardingDbContextExecutor)} from {nameof(shardingDbContext.GetShardingExecutor)}");
}
#endif