DataAccessAdapterCoreGetDbCount Method (IEntityFields2, IRelationPredicateBucket, IGroupByCollection, Boolean) |
Gets the number of rows returned by a query for the fields specified, using the filter and groupby clause specified.
Namespace:
SD.LLBLGen.Pro.ORMSupportClasses
Assembly:
SD.LLBLGen.Pro.ORMSupportClasses (in SD.LLBLGen.Pro.ORMSupportClasses.dll) Version: 5.11.0.0 (5.11.23.1114)
Syntax public virtual int GetDbCount(
IEntityFields2 fields,
IRelationPredicateBucket filter,
IGroupByCollection groupByClause,
bool allowDuplicates
)
Public Overridable Function GetDbCount (
fields As IEntityFields2,
filter As IRelationPredicateBucket,
groupByClause As IGroupByCollection,
allowDuplicates As Boolean
) As Integer
Parameters
- fields
- Type: SD.LLBLGen.Pro.ORMSupportClassesIEntityFields2
IEntityFields2 instance with the fields returned by the query to get the rowcount for - filter
- Type: SD.LLBLGen.Pro.ORMSupportClassesIRelationPredicateBucket
filter to use by the query to get the rowcount for - groupByClause
- Type: SD.LLBLGen.Pro.ORMSupportClassesIGroupByCollection
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. - allowDuplicates
- Type: SystemBoolean
When true, it will not filter out duplicate rows, otherwise it will DISTINCT duplicate rows.
Return Value
Type:
Int32the number of rows the query for the fields specified, using the filter, relations and groupbyClause specified.
Implements
IDataAccessAdapterGetDbCount(IEntityFields2, IRelationPredicateBucket, IGroupByCollection, Boolean)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