简体   繁体   English

Dynamics 365 - Linq 查询不存在条件

[英]Dynamics 365 - Linq query with a not exists condition

I have used the below linq query to translate a sql query with a not exists condition.我使用了下面的 linq 查询来翻译一个不存在条件的 sql 查询。

(from jdgAcc in srv.mn_jdg_accountsSet
where
!srv.mn_jdg_accountsSet.Where(jdgAcc1 => (jdgAcc1.mn_account.Id == jdgAcc.mn_account.Id)
&& (jdgAcc1.mn_contact.Id != jdgAcc.mn_contact.Id)).Any()
select jdgAcc.mn_account.Name)

But this throws an "Invalid 'where' condition. An entity member is invoking an invalid property or method."但这会引发“无效的 'where' 条件。实体成员正在调用无效的属性或方法。” exception.例外。

Please let me know whats wrong with this query.请让我知道这个查询有什么问题。 I am not able to transform this into a list and get the count because of this error.由于此错误,我无法将其转换为列表并获取计数。

Thanks,谢谢,

Sharmila.莎米拉。

The LINQ for CRM implementation is limited, in the first place due to the fact these queries must be convertable to QueryExpression queries.用于 CRM 实施的 LINQ 受到限制,首先是因为这些查询必须可转换为QueryExpression查询。 Unfortunately LINQ for CRM does not support Not Exists conditions.不幸的是,CRM 的 LINQ 不支持不存在条件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM