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
cacheContextICacheContextThe context giving access to the registered caches.
loggerFactoryILoggerFactoryThe factory of loggers.
serializationIObjectSerializationThe serializer of the list of keys.
cacheKeystringThe key under which the list of keys is stored.
cacheNamestringThe name of the cache. When empty, the default cache is used.
Exceptions
- ArgumentNullException
An argument other than
cacheNameis null.
Methods
GetAllElements()
Gets all top-level XML elements in the repository.
public IReadOnlyCollection<XElement> GetAllElements()
Returns
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
elementXElementThe element to add.
friendlyNamestringAn 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.