AdapterExtensionMethodsFetchQueryAsyncTEntity, TCollection Method (IDataAccessAdapter, EntityQueryTEntity, TCollection, CancellationToken) |
Namespace:
SD.LLBLGen.Pro.QuerySpec.Adapter
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.6.0.0 (5.6.19.0117)
Syntax public static Task<TCollection> FetchQueryAsync<TEntity, TCollection>(
this IDataAccessAdapter adapter,
EntityQuery<TEntity> query,
TCollection collectionToFill,
CancellationToken cancellationToken
)
where TEntity : IEntity2
where TCollection : IEntityCollection2
<ExtensionAttribute>
Public Shared Function FetchQueryAsync(Of TEntity As IEntity2, TCollection As IEntityCollection2) (
adapter As IDataAccessAdapter,
query As EntityQuery(Of TEntity),
collectionToFill As TCollection,
cancellationToken As CancellationToken
) As Task(Of TCollection)
Parameters
- adapter
- Type: SD.LLBLGen.Pro.ORMSupportClassesIDataAccessAdapter
The adapter. - query
- Type: SD.LLBLGen.Pro.QuerySpecEntityQueryTEntity
The query. - collectionToFill
- Type: TCollection
The collection to fill. - cancellationToken
- Type: System.ThreadingCancellationToken
The cancellation token
Type Parameters
- TEntity
- The type of the entity.
- TCollection
- The type of the collection.
Return Value
Type:
TaskTCollectioncollectionToFill, filled with the query fetch results.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IDataAccessAdapter. 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 Equal to calling adapter.FetchEntityCollection(), so entities already present in collectionToFill are left as-is.
If the fetch has to take into account a Context, the passed collectionToFill has to be assigned to the context before calling this method.
See Also