8.1.5.2 GetCountOfState
This method returns the number of rows in the underlying Oracle database that are within the specified scope.
Declaration
// C# public override int GetCountOfState(PersonalizationScope scope, PersonalizationStateQuery query);
Parameters
-
scopeThe scope of query (User or Shared) for personalization information. This cannot be a null reference.
-
queryThe query to be used for filtering personalization information. This can be a null reference.
Return Value
The number of rows in the underlying data source that are within the specified scope parameter.
Exceptions
ArgumentException -The PathToMatch or the UsernameToMatch property of query is a non-null reference and is an empty string ("") after trimming.
ArgumentOutOfRangeException - The scope specified is not a valid value from the PersonalizationScope enumeration.
OracleException - An Oracle-related error has occurred.
Remarks
This method passes the query wildcard characters to the underlying Oracle database. The database performs a wildcard search on a partial path with the wildcard character appearing at the beginning, the end, or the middle of the search string text in the PathToMatch property of the query parameter. For example, setting the PathToMatch property to ~/appdir% finds all paths that start with ~/appdir.
Likewise, in a wildcard search on a partial user name, the wildcard character can appear at any point in the text string of the UsernameToMatch property of the query parameter. For example, to find all user names that start with scott, the UsernameToMatch parameter looks like scott%
The following query constraints must be followed:
-
If only the
scopeparameter is provided, and thequeryparameter is a null reference or all the properties on thequeryparameter return either a null reference or default values, then all records matching the indicatedscopeparameter are returned. -
If the
PathToMatchproperty is not a null reference, then the records returned are also filtered based on paths that match thePathToMatchvalue. -
If the
UsernameToMatchproperty is not a null reference, then the returned records are also filtered based on user names that match theUsernameToMatchproperty value. -
If the
UserInactiveSinceDateproperty is not equal to theMaxValue, then the returned records are also filtered to return only those records associated with inactive users. The comparison includes records where theLastActivityDateproperty is less than or equal to theUserInactiveSinceDateproperty.