修复bug

This commit is contained in:
xuejiaming 2022-09-14 16:44:41 +08:00
parent a939058cd1
commit afec836c52
2 changed files with 5 additions and 25 deletions

View File

@ -7,15 +7,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src5x\ShardingCore.5x\ShardingCore.5x.csproj" />
<ProjectReference Include="..\..\src\ShardingCore\ShardingCore.csproj" />
</ItemGroup>

View File

@ -102,10 +102,10 @@ namespace ShardingCore.Core.Internal.Visitors
if (RootIsVisit&&node.Method.ReturnType.IsMethodReturnTypeQueryableType()&&node.Method.ReturnType.IsGenericType)
{
#if EFCORE2 || EFCORE3
var notRoot = node.Arguments.All(o => !(o is ConstantExpression constantExpression&&constantExpression.Value is IQueryable));
var notRoot = node.Arguments.IsEmpty();
#endif
#if !EFCORE2 && !EFCORE3
var notRoot = node.Arguments.All(o => !(o is QueryRootExpression));
var notRoot = node.Arguments.IsEmpty();
#endif
if (notRoot)
{
@ -131,12 +131,6 @@ namespace ShardingCore.Core.Internal.Visitors
return whereCallExpression;
}
public Expression<Func<T, bool>> WhereTrueExpression<T>()
{
return t => true;
}
internal sealed class TempVariable<T1>
{
public IQueryable<T1> Queryable { get; }
@ -151,20 +145,6 @@ namespace ShardingCore.Core.Internal.Visitors
return Queryable;
}
}
internal sealed class TempMethodVariable<T1>
{
public IQueryable<T1> Queryable { get; }
public TempMethodVariable(Func<IQueryable<T1>> func)
{
Queryable = func();
}
public IQueryable<T1> GetQueryable()
{
return Queryable;
}
}
internal sealed class TempDbVariable<T1>
{