Class DistributedIDCache
The distributed ID cache stores IDs in a distributed cache.
The distributed ID cache is suitable for applications deployed to a web farm.
Implements
Inherited Members
Namespace: ComponentSpace.Saml2.Cache
Assembly: ComponentSpace.Saml2.dll
Syntax
public class DistributedIDCache : IIDCache
  Constructors
DistributedIDCache(IDistributedCache, ILoggerFactory)
Initializes a new instance of the DistributedIDCache class.
Declaration
public DistributedIDCache(IDistributedCache distributedCache, ILoggerFactory loggerFactory)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IDistributedCache | distributedCache | The distributed cache used to store IDs.  | 
      
| ILoggerFactory | loggerFactory | The logger factory.  | 
      
Methods
AddAsync(string, DateTime)
Adds the ID with an associated expiration time to the cache.
Declaration
public Task<bool> AddAsync(string id, DateTime expirationDateTime)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | id | The ID.  | 
      
| DateTime | expirationDateTime | The expiration time.  | 
      
Returns
| Type | Description | 
|---|---|
| Task<bool> | A task that represents the add operation and returns   | 
      
Exceptions
| Type | Condition | 
|---|---|
| SamlEnvironmentException | Thrown if the ID cannot be added to the cache.  | 
      
RemoveAsync(string)
Removes the ID from the cache.
Declaration
public Task RemoveAsync(string id)
  Parameters
| Type | Name | Description | 
|---|---|---|
| string | id | The ID.  | 
      
Returns
| Type | Description | 
|---|---|
| Task | A task that represents the remove operation.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SamlEnvironmentException | Thrown if the ID cannot be added to the cache.  |