From e02225e32e6ab50521be2edf4d96f40f13eb54c8 Mon Sep 17 00:00:00 2001 From: xuejiaming <326308290@qq.com> Date: Fri, 24 Nov 2023 08:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E8=AF=91=E4=B8=8D?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=86=85=E9=83=A8=E5=8F=96=E5=8F=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sharding/Visitors/DbContextReplaceQueryableVisitor.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs index 85e93609..953b0db1 100644 --- a/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs +++ b/src/ShardingCore/Sharding/Visitors/DbContextReplaceQueryableVisitor.cs @@ -191,7 +191,7 @@ namespace ShardingCore.Core.Internal.Visitors var dbContextDependencies = typeof(DbContext).GetTypePropertyValue(_dbContext, "DbContextDependencies") as IDbContextDependencies; -#if !EFCORE7&& !EFCORE8 +#if EFCORE5 || EFCORE6 var targetIQ = (IQueryable)((IDbSetCache)_dbContext).GetOrAddSet(dbContextDependencies.SetSource, queryRootExpression.EntityType.ClrType); @@ -209,7 +209,7 @@ namespace ShardingCore.Core.Internal.Visitors RootIsVisit = true; if (queryRootExpression is FromSqlQueryRootExpression fromSqlQueryRootExpression) { -#if !EFCORE7 && !EFCORE8 +#if EFCORE5 || EFCORE6 var sqlQueryRootExpression = new FromSqlQueryRootExpression(newQueryable.Provider as IAsyncQueryProvider, queryRootExpression.EntityType, fromSqlQueryRootExpression.Sql, fromSqlQueryRootExpression.Argument);