Click or drag to resize

AdapterExtensionMethods.FetchQueryAsync<TEntity, TCollection> Method (IDataAccessAdapter, EntityQuery<TEntity>, TCollection, CancellationToken)

Namespace:  SD.LLBLGen.Pro.QuerySpec.Adapter
Assembly:  SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.5.0.0 (5.5.18.1019)
Syntax
public static Task<TCollection> FetchQueryAsync<TEntity, TCollection>(
	this IDataAccessAdapter adapter,
	EntityQuery<TEntity> query,
	TCollection collectionToFill,
	CancellationToken cancellationToken
)
where TEntity : IEntity2
where TCollection : IEntityCollection2

Parameters

adapter
Type: SD.LLBLGen.Pro.ORMSupportClasses.IDataAccessAdapter
The adapter.
query
Type: SD.LLBLGen.Pro.QuerySpec.EntityQuery<TEntity>
The query.
collectionToFill
Type: TCollection
The collection to fill.
cancellationToken
Type: System.Threading.CancellationToken
The cancellation token

Type Parameters

TEntity
The type of the entity.
TCollection
The type of the collection.

Return Value

Type: Task<TCollection>
collectionToFill, 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