Filtering entities based on entity property value
Posted: Mon 16 Mar 2009 21:19
I am trying to filter certain entities according to the value of a certain property when performing a query. However, I want to filter the entity based on a child tables property value.
For instance, let's say I have 3 entities where entity A has a 1-* association to entity B which has a 1-* association with entity C. What I want to do is filter out all entity Bs that do not have any entity Cs with a certain ID.
Also, I would like to perform this filtering in one query while I get all three entities. (I was looking at using the Attach and CreateSourceQuery methods but I cannot seem to get it to work.) Is this possible or do I have to break it up into different queries?
Thanks.
For instance, let's say I have 3 entities where entity A has a 1-* association to entity B which has a 1-* association with entity C. What I want to do is filter out all entity Bs that do not have any entity Cs with a certain ID.
Also, I would like to perform this filtering in one query while I get all three entities. (I was looking at using the Attach and CreateSourceQuery methods but I cannot seem to get it to work.) Is this possible or do I have to break it up into different queries?
Thanks.