检索CRM 2011的Entites清单,每个企业都有其所有相关实体[英] Retrieve a list of entites from CRM 2011, each with all of their related entities

本文是小编为大家收集整理的关于检索CRM 2011的Entites清单,每个企业都有其所有相关实体的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我在CRM 2011中有两个实体 - emailmatchingrule和emailmatchingrulefield,在标准的亲子关系中.我要检索的是所有规则的集合,每个规则的所有字段都被预先挑选为相关实体.

这甚至可能吗?我可以使用查询表达addlinkentity功能获得一个扁平的列表,但这并不是我真正追求的.
使用早期绑定的实体和LINQ,我只能弄清楚如何获取每个列表,但没有相关项目.

有什么想法?

tia

推荐答案

您的LINQ语句需要使用" include".

from rule in EmailMatchingRule.Include("EmailMatchingRuleField")
select rule

您将获得的规则集合将拥有所有匹配规则,现在已经急切地加载了.

本文地址:https://www.itbaoku.cn/post/1556848.html

问题描述

I have two entities in CRM 2011 - EmailMatchingRule and EmailMatchingRuleField, in a standard parent-child relationship. What I want to retrieve is a set of all of the rules, each with all of its fields pre-fetched as related entities.

Is this even possible? I can get a flattened list using the QueryExpression AddLinkEntity functionality, but that's not really what I'm after.
Using early bound entities and Linq, I can only figure out how to get a list of each, but without the related items.

Any thoughts ?

TIA

推荐答案

Your linq statement needs to use an "Include".

from rule in EmailMatchingRule.Include("EmailMatchingRuleField")
select rule

The collection of rules you'll get back will have all the matching rules now already eagerly loaded.