This documentation is archived and is not being maintained.
How to: Filter Related Data (LINQ to SQL)
Visual Studio 2010
Use the AssociateWith method to specify sub-queries to limit the amount of retrieved data.
In the following example, the AssociateWith method limits the Orders retrieved to those that have not been shipped today. Without this approach, all Orders would have been retrieved even though only a subset is desired.
Show: