LinqExtensionsPreloadTSource Method (IEnumerableTSource) |
Preloads the full object state for all objects in source.
Namespace:
Aloe.SystemFrameworks.Domain.LINQ
Assembly:
Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntaxpublic static IEnumerable<TSource> Preload<TSource>(
this IEnumerable<TSource> source
)
where TSource : ILazyObject
<ExtensionAttribute>
Public Shared Function Preload(Of TSource As ILazyObject) (
source As IEnumerable(Of TSource)
) As IEnumerable(Of TSource)
public:
[ExtensionAttribute]
generic<typename TSource>
where TSource : ILazyObject
static IEnumerable<TSource>^ Preload(
IEnumerable<TSource>^ source
)
[<ExtensionAttribute>]
static member Preload :
source : IEnumerable<'TSource> -> IEnumerable<'TSource> when 'TSource : ILazyObject
Parameters
- source
- Type: System.Collections.GenericIEnumerableTSource
The source objects.
Type Parameters
- TSource
- The type of the source.
Return Value
Type:
IEnumerableTSourceThe same source objects enumeration.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
Preload will execute a single command, retrieving all objects in the source enumeration. For example:
invoices.Preload();
invoices.Select(i=>i.Customer).Preload();
See Also