This documentation is archived and is not being maintained.
DataLoadOptions::LoadWith<T> Method (Expression<Func<T, Object>>)
Visual Studio 2010
Specifies which sub-objects to retrieve when a query is submitted for an object of type T.
Assembly: System.Data.Linq (in System.Data.Linq.dll)
Type Parameters
- T
Type that is queried against.
If this type is unmapped, an exception is thrown.
Parameters
- expression
- Type: System.Linq.Expressions::Expression<Func<T, Object>>
Identifies the field or property to be retrieved.
If the expression does not identify a field or property that represents a one-to-one or one-to-many relationship, an exception is thrown.
You cannot specify the loading of two levels of relationships (for example, Orders.OrderDetails). In these scenarios you must specify two separate LoadWith methods.
To avoid cycling, see Remarks section in DataLoadOptions.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: