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.
Inheritance
System.Object
DistributedIDCache
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
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 |
---|---|---|
Microsoft.Extensions.Caching.Distributed.IDistributedCache | distributedCache | The distributed cache used to store IDs. |
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory. |
Methods
AddAsync(String, DateTime)
Adds the ID with an associated expiration time to the cache.
Declaration
public async Task<bool> AddAsync(string id, DateTime expirationDateTime)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID. |
System.DateTime | expirationDateTime | The expiration time. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | 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 |
---|---|---|
System.String | id | The ID. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the remove operation. |
Exceptions
Type | Condition |
---|---|
SamlEnvironmentException | Thrown if the ID cannot be added to the cache. |