我有一个 LINQ 查询,它对独立列表工作正常,但对 CRM 失败
var lst = new List<bool?>();
lst.Add(null);
lst.Add(true);
lst.Add(false);
bool IsWet = false;
var newlst = from exch_HideVoiceSignature in lst where
(((exch_HideVoiceSignature!=null && exch_HideVoiceSignature==false
|| exch_HideVoiceSignature== null) )&& !IsWet) select exch_HideVoiceSignature;
newlst.Dump();
var question = from q in exch_questionSet where ((q.exch_HideVoiceSignature != null
&& q.exch_HideVoiceSignature.Value == 0 )|| q.exch_HideVoiceSignature == null )
&& !IsWet select q.exch_HideVoiceSignature;
question.FirstOrDefault().Dump();
如您所见,我可以将变量 IsWet 传递给 LINQ 查询以获得标准列表,并获取第一个列表的值。但是当我对第二个列表执行相同的操作时,我收到以下错误
'where' 条件无效。实体成员正在调用无效的属性或方法