views:

255

answers:

1

when i use Linq2Sql i can filter a table by using a lambda-expression in the DataLoadOptions.AssociateWith method.

i use this for filtering the used language - so i have a language table with all languages and a object table containing objects.

like:

DataLoadOptions opt = ...;
opt.AssociateWith<DB.Objects>(o => o.Language.Where(p => p.Culture == CurrentUser.Culture));

how to do that with the entity-framework - where i have to use .Include(string) instead of the dataloadoptions?

+1  A: 

The answer is here :

Tip 37 – How to do a Conditional Include

Afshin Gh
This should be made as a comment, not as an answer. I would simply add a comment to the original question reiterating that your desire for an answer, and delete this.
jrista
@jrista: Thnx for heads up. Found the answer and changed this post.
Afshin Gh