Can an EntityField2 be used instead of a literal value when using a predicate?
For example, I have a several IPrefetchPathElements that I am building for a large query:
In this case, if I use a literal value instead of using "ClientContactsFields.ClientContactId", the query will work. However by using "ClientContactsFields.ClientContactId" instead, I get and error "The multi-part identifier "client_contacts.client_contact_id" could not be bound."
The problem is I do not have the value of "ClientContactId" yet, because I am assembling the prefetch paths. I am hoping not to have to add a query to get the value first (it seems like an unnecessary trip to the DB)
ppeClientPlans.Filter.Add(
new FieldCompareSetPredicate(ClientPlansFields.ClientPlanId, null,
ClientContactClientPlansRolesRelFields.ClientPlanId, null,
SetOperator.In,
(ClientContactClientPlansRolesRelFields.ClientContactId ==
ClientContactsFields.ClientContactId)
));
How can you compare to a field in another Entity, when you have not yet retrieved the value?