[英]Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool>
I'm Using Dynamic Linq library and there is Source code and basic docu and the Nuget version 我正在使用Dynamic Linq库 ,有源代码和基本文档以及Nuget版本
PM> Install-Package DynamicLINQ PM> Install-Package DynamicLINQ
I'm trying to construct a where clause that involves Guids 我正在尝试构建一个涉及Guids的where子句
I have tried with the string "Id == @0"
. 我尝试过使用字符串
"Id == @0"
。 The parameter array is just an object[]
with the value ( Guid xxxx
) 参数数组只是一个带有值的
object[]
( Guid xxxx
)
var whereClauseSB = BuildLogicalKeyWhereClause2(entity, logicalKey); //build string
var parms = BuildParamArray(entity, logicalKey); // object[]
var whereLambda = Ofsi.Bos.Core.DynamicExpression.ParseLambda<T, bool>(whereClauseSB.ToString(),parms); //parse
an exception is thrown in DynamicExpression.ParseLambda DynamicExpression.ParseLambda中抛出异常
Operator '==' incompatible with operand types 'Guid' and 'Guid'
运算符'=='与操作数类型'Guid'和'Guid'不兼容
Any ideas? 有任何想法吗?
尝试在字符串中使用Equals
方法而不是==
运算符:
"Id.Equals(@0)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.