第一个全版本

This commit is contained in:
xuejiaming 2021-08-20 22:30:06 +08:00
parent 5a4dee9360
commit 8f3b6b3aad
3 changed files with 13 additions and 14 deletions

View File

@ -1,8 +1,8 @@
:start
::定义版本
set EFCORE2=2.1.0.21
set EFCORE3=3.1.0.21
set EFCORE5=5.2.0.02
set EFCORE2=2.2.0.03
set EFCORE3=3.2.0.03
set EFCORE5=5.2.0.03
::删除所有bin与obj下的文件
@echo off

View File

@ -6,11 +6,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.9" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src2x\ShardingCore.2x\ShardingCore.2x.csproj" />
<ProjectReference Include="..\..\src\ShardingCore\ShardingCore.csproj" />
</ItemGroup>
</Project>

View File

@ -44,14 +44,18 @@ namespace ShardingCore.Sharding.Enumerators
{
_source.Dispose();
}
private bool _canMoveNext=true;
public async Task<bool> MoveNext(CancellationToken cancellationToken=new CancellationToken())
{
if (skip)
{
skip = false;
return null!=_source.Current;
_canMoveNext= null != _source.Current;
return _canMoveNext;
}
return await _source.MoveNext(cancellationToken);
_canMoveNext= await _source.MoveNext(cancellationToken);
return _canMoveNext;
}
#endif
@ -76,14 +80,9 @@ namespace ShardingCore.Sharding.Enumerators
#if EFCORE2
public bool HasElement()
{
try
{
return null != _source.Current;
}
catch
{
if (!_canMoveNext)
return false;
}
return null != _source.Current;
}
#endif