第一个全版本

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 :start
::定义版本 ::定义版本
set EFCORE2=2.1.0.21 set EFCORE2=2.2.0.03
set EFCORE3=3.1.0.21 set EFCORE3=3.2.0.03
set EFCORE5=5.2.0.02 set EFCORE5=5.2.0.03
::删除所有bin与obj下的文件 ::删除所有bin与obj下的文件
@echo off @echo off

View File

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

View File

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