Show / Hide Table of Contents

Class DatabaseIDCache

The database ID cache stores IDs in a database.

The database ID cache is suitable for applications deployed to a web farm.

Inheritance
object
DatabaseIDCache
Implements
IIDCache
IDisposable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: ComponentSpace.SAML2.Cache
Assembly: ComponentSpace.Saml2.dll
Syntax
public class DatabaseIDCache : IIDCache, IDisposable

Constructors

DatabaseIDCache()

Constructs a DatabaseIDCache.

The default database connection string name is assumed to be configured in web.config.

Declaration
public DatabaseIDCache()

DatabaseIDCache(string)

Constructs a DatabaseIDCache.

Declaration
public DatabaseIDCache(string connectionStringName)
Parameters
Type Name Description
string connectionStringName

The database connection string name configured in web.config.

DatabaseIDCache(string, string)

Constructs a DatabaseIDCache.

Declaration
public DatabaseIDCache(string connectionStringName, string tableName)
Parameters
Type Name Description
string connectionStringName

The database connection string name configured in web.config.

string tableName

The database table name or null to use the default name.

DatabaseIDCache(string, string, string)

Constructs a DatabaseIDCache.

Declaration
public DatabaseIDCache(string providerName, string connectionString, string tableName)
Parameters
Type Name Description
string providerName

The database provider name.

string connectionString

The database connection string.

string tableName

The database table name or null to use the default name.

Properties

DeleteExpiredPriorToAdd

Gets or sets the flag indicating whether expired entries should be deleted prior to adding an entry. The default is true.

Declaration
public bool DeleteExpiredPriorToAdd { get; set; }
Property Value
Type Description
bool

The flag indicating whether expired entries should be deleted prior to adding an entry.

ExpirationDateTimeColumnName

Gets or sets the name of the expiration date/time column. The default name is ExpirationDateTime.

Declaration
public string ExpirationDateTimeColumnName { get; set; }
Property Value
Type Description
string

The name of the expiration date/time column.

IDColumnName

Gets or sets the name of the ID column. The default name is ID.

Declaration
public string IDColumnName { get; set; }
Property Value
Type Description
string

The name of the ID column.

Methods

Add(string, DateTime)

Adds the ID with an associated expiration time to the cache.

Declaration
public virtual bool Add(string id, DateTime expirationDateTime)
Parameters
Type Name Description
string id

The ID.

DateTime expirationDateTime

The expiration time.

Returns
Type Description
bool

true if the ID doesn't already exist in the cache; otherwise false.

DeleteExpired()

Deletes any expired IDs from the cache.

Declaration
public virtual int DeleteExpired()
Returns
Type Description
int

The number of expired IDs deleted from the cache.

Dispose()

Dispose of the database ID cache.

Declaration
public void Dispose()

Dispose(bool)

Dispose of the database ID cache.

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true if called by user code; false if called by the runtime from within the finalizer

StartDeletingExpired(TimeSpan, TimeSpan)

Schedules the deletion of expired IDs starting at the due time and repeating periodically.

Declaration
public virtual void StartDeletingExpired(TimeSpan dueTime, TimeSpan period)
Parameters
Type Name Description
TimeSpan dueTime

The due time to start deleting expired IDs.

TimeSpan period

The period to wait before next deleting expired IDs.

StopDeletingExpired()

Stops any scheduled deletion of expired IDs.

Declaration
public virtual void StopDeletingExpired()

Implements

IIDCache
IDisposable
In this article
Back to top Copyright © ComponentSpace Pty Ltd 2004-2025. All rights reserved.