Returns the number of records of the specified type in the database

Namespace: Castle.ActiveRecord
Assembly:  Castle.ActiveRecord (in Castle.ActiveRecord.dll)
Version: 1.0.3.0

Syntax

C#
protected internal static int Count(
	Type targetType
)

Parameters

targetType
Type
Type of the target.

Return Value

The count result

Examples

CopyC#
[ActiveRecord]
public class User : ActiveRecordBase
{
  ...

  public static int CountUsers()
  {
    return Count(typeof(User));
  }
}

See Also