开发者

Retrieve a list of entites from CRM 2011, each with all of their related entities

开发者 https://www.devze.com 2023-03-08 23:52 出处:网络
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 field

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 Ad开发者_如何学GodLinkEntity 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消