经过一夜的思考和早上一双新的眼睛后,我意识到我只需要将列表成员链接到联系人,就像我使用 by ID 选项一样,然后在联系人实体上添加一个附加链接电子邮件地址。
<fetch mapping="logical" version="1.0" page="1" count="100" >
<entity name="contact" >
<link-entity name="listmember" from="entityid" to="contactid" >
<filter>
<condition attribute="listid" operator="eq" value="06197bff-a299-e311-aae4-6c3be5a892e8" />
</filter>
</link-entity>
<attribute name="contactid" />
<attribute name="emailaddress1" />
<filter type="and" >
<condition attribute="emailaddress1" operator="not-null" />
<condition attribute="donotbulkemail" operator="ne" value="1" />
</filter>
<link-entity name="listmember" from="entityid" to="contactid" link-type="outer" alias="exclusionlist" >
<attribute name="entityid" />
<filter type="and" >
<condition attribute="listid" operator="eq" value="06197bff-a299-e311-aae4-6c3be5a892e8" />
</filter>
</link-entity>
<link-entity name="contact" from="emailaddress1" to="emailaddress1" link-type="outer" alias="emailaddress" >
<attribute name="fullname" />
<attribute name="emailaddress1" />
</link-entity>
<order descending="false" attribute="emailaddress1" />
</entity>
然后我们通过别名过滤掉结果:'
results = results.Where(x => !x.Contains("exclusionlist.entityid") || !x.Contains("emailaddress.emailaddress1")).ToList();
希望这对其他人有所帮助,尽管我现在问起来确实有点愚蠢...