Returns the number of entities of a specified type based on the supplied Type and Query.

Namespace:  Mindscape.LightSpeed
Assembly:  Mindscape.LightSpeed (in Mindscape.LightSpeed.dll)
Version: 4.0.0.0 (4.0.0.0)

Syntax

C#
long Count<TEntity>(
	Query query
) where TEntity : Entity
Visual Basic (Declaration)
Function Count(Of TEntity As Entity) ( _
	query As Query _
) As Long

Type Parameters

TEntity
The entity type.

Return Value

The number of entities.

Examples

CopyC#
Query query = new Query(Entity.Attribute("Price") > 1000000);
long expensiveProductCount = unitOfWork.Count<Product>(query);

See Also