Gets the estimated number of objects returned by a query for objects to store in the entity collection passed in, using the filter and groupby clause specified. The number is estimated as duplicate objects can be present in the raw query results, but will be filtered out when the query result is transformed into objects.

Namespace: MonoSoftware.LLBLGen
Assembly: MonoSoftware.LLBLGen (in MonoSoftware.LLBLGen.dll) Version: 1.0.40.661 (1.0.40.661)

Syntax

C#
public int GetDbCount(
	IEntityCollection2 collection,
	IRelationPredicateBucket filter,
	IGroupByCollection groupByClause
)
Visual Basic
Public Function GetDbCount ( 
	collection As IEntityCollection2,
	filter As IRelationPredicateBucket,
	groupByClause As IGroupByCollection
) As Integer
Visual C++
public:
virtual int GetDbCount(
	IEntityCollection2^ collection, 
	IRelationPredicateBucket^ filter, 
	IGroupByCollection^ groupByClause
) sealed
F#
abstract GetDbCount : 
        collection : IEntityCollection2 * 
        filter : IRelationPredicateBucket * 
        groupByClause : IGroupByCollection -> int 
override GetDbCount : 
        collection : IEntityCollection2 * 
        filter : IRelationPredicateBucket * 
        groupByClause : IGroupByCollection -> int 

Parameters

collection
Type: IEntityCollection2
EntityCollection instance which will be fetched by the query to get the rowcount for
filter
Type: IRelationPredicateBucket
filter to use by the query to get the rowcount for
groupByClause
Type: IGroupByCollection
The list of fields to group by on. When not specified or an empty collection is specified, no group by clause is added to the query. A check is performed for each field in the selectList. If a field in the selectList is not present in the groupByClause collection, an exception is thrown.

Return Value

Type: Int32
the number of rows the query for the fields specified, using the filter, relations and groupbyClause specified.

Implements

IRepository..::..GetDbCount(IEntityCollection2, IRelationPredicateBucket, IGroupByCollection)

Remarks

This method performs a SELECT COUNT(*) FROM (actual query) and executes that as a scalar query. This construct is not supported on Firebird. You can try to achieve the same results by using GetScalar and AggregateFunction.CountRow, though those results can differ from the result returned by GetDbCount if you use a group by clause.

See Also