This commit is contained in:
xuejiaming 2021-09-22 20:48:03 +08:00
parent 8f665394ff
commit 3aec0399d0
2 changed files with 13 additions and 7 deletions

View File

@ -1,8 +1,8 @@
:start :start
::定义版本 ::定义版本
set EFCORE2=2.2.0.20 set EFCORE2=2.2.0.21
set EFCORE3=3.2.0.20 set EFCORE3=3.2.0.21
set EFCORE5=5.2.0.20 set EFCORE5=5.2.0.21
::删除所有bin与obj下的文件 ::删除所有bin与obj下的文件
@echo off @echo off

View File

@ -109,10 +109,11 @@ namespace ShardingCore.Sharding.Enumerators
#if EFCORE2 #if EFCORE2
public void Dispose() public void Dispose()
{ {
_asyncSource.Dispose(); _asyncSource?.Dispose();
_syncSource?.Dispose();
} }
public async Task<bool> MoveNext(CancellationToken cancellationToken=new CancellationToken()) public async Task<bool> MoveNext(CancellationToken cancellationToken = new CancellationToken())
{ {
if (skip) if (skip)
{ {
@ -134,8 +135,13 @@ namespace ShardingCore.Sharding.Enumerators
{ {
if (tryGetCurrentError) if (tryGetCurrentError)
return default; return default;
if (_asyncSource!= null)
return _asyncSource.Current; return _asyncSource.Current;
}catch(Exception e) if (_syncSource != null)
return _syncSource.Current;
return default;
}
catch (Exception e)
{ {
tryGetCurrentError = true; tryGetCurrentError = true;
return default; return default;