优化编译不使用内部取反

This commit is contained in:
xuejiaming 2023-11-24 08:23:28 +08:00
parent 626bbb0f4c
commit e02225e32e
1 changed files with 2 additions and 2 deletions

View File

@ -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);