为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:dm8_20240123_x86_rh6_rq_ent_8.1.3.100
【操作系统】:linux docker
【CPU】:x68
【问题描述】*:EFCore linq生成SQL查询bool值不能使用
[14:48:27 ERR] Failed executing DbCommand (11ms) [Parameters=[:__ef_filter__p_0='?'** (DbType = Boolean)**, :__ef_filter__p_1='?' (DbType = Boolean)], CommandType='Text', CommandTimeout='30']
SELECT "d"."Id", "d"."CampusId", "d"."CreationTime", "d"."CreatorId", "d"."DeleterId", "d"."DeletionTime", "d"."IsDeleted", "d"."LastModificationTime", "d"."LastModifierId", "d"."Name", "d"."Sort", "d"."TenantId"
FROM "DeviceGroup" AS "d"
WHERE **(:__ef_filter__p_0 OR NOT ("d"."IsDeleted")) **AND (:__ef_filter__p_1 OR ("d"."TenantId" IS NULL))
ORDER BY "d"."Sort"
[14:48:27 ERR] An exception occurred while iterating over the results of a query for context type 'Fisher361.SaasDeviceControlService.EntityFrameworkCore.SaasDeviceControlServiceControlServiceDbContext'.
Dm.DmException (0x80004005): 第4 行附近出现错误:
查询使用值表达式作为过滤条件
at Dm.DmCommand.do_ExecuteDbDataReader(CommandBehavior behavior)
at Dm.DmCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
--- End of stack trace from previous location ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Dm.Storage.Internal.DmExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func
4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable
1.AsyncEnumerator.MoveNextAsync()
您代码里拼接出来的sql,方便发一下吗?看代码初步判断是sql语法存在问题,"d"."IsDeleted"这里不能光有一个列在这个