Table of Contents

Class CacheStore

Namespace
Arc4u.OAuth2.DataProtection
Assembly
Arc4u.OAuth2.AspNetCore.Authentication.dll

An IXmlRepository that persists the ASP.NET Core data protection keys in an Arc4u cache, so they are shared by all the instances of an application.

public class CacheStore : IXmlRepository
Inheritance
CacheStore
Implements
Inherited Members

Constructors

CacheStore(ICacheContext, ILoggerFactory, IObjectSerialization, string, string?)

Initializes a new instance of the CacheStore class.

public CacheStore(ICacheContext cacheContext, ILoggerFactory loggerFactory, IObjectSerialization serialization, string cacheKey, string? cacheName = null)

Parameters

cacheContext ICacheContext

The context giving access to the registered caches.

loggerFactory ILoggerFactory

The factory of loggers.

serialization IObjectSerialization

The serializer of the list of keys.

cacheKey string

The key under which the list of keys is stored.

cacheName string

The name of the cache. When empty, the default cache is used.

Exceptions

ArgumentNullException

An argument other than cacheName is null.

Methods

GetAllElements()

Gets all top-level XML elements in the repository.

public IReadOnlyCollection<XElement> GetAllElements()

Returns

IReadOnlyCollection<XElement>

Remarks

All top-level elements in the repository.

StoreElement(XElement, string)

Adds a top-level XML element to the repository.

public void StoreElement(XElement element, string friendlyName)

Parameters

element XElement

The element to add.

friendlyName string

An optional name to be associated with the XML element. For instance, if this repository stores XML files on disk, the friendly name may be used as part of the file name. Repository implementations are not required to observe this parameter even if it has been provided by the caller.

Remarks

The 'friendlyName' parameter must be unique if specified. For instance, it could be the id of the key being stored.