#### [Abblix\.Oidc\.Server\.Mvc](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc 'index')
### [Abblix\.Oidc\.Server\.Mvc\.Features\.SessionManagement](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Features.SessionManagement 'Abblix\.Oidc\.Server\.Mvc\.Features\.SessionManagement')

## CheckSessionResponseCache Class

Represents a cache for storing and retrieving CheckSession responses asynchronously\.

```csharp
public class CheckSessionResponseCache : Abblix.Oidc.Server.Mvc.Features.SessionManagement.ICheckSessionResponseCache
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → CheckSessionResponseCache

Implements [ICheckSessionResponseCache](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Features.SessionManagement.ICheckSessionResponseCache 'Abblix\.Oidc\.Server\.Mvc\.Features\.SessionManagement\.ICheckSessionResponseCache')

### Remarks
This cache is used to store CheckSession responses for quick retrieval, reducing the need to recompute them
for the same input key\.
### Constructors

## CheckSessionResponseCache\(IOptions\<MemoryCacheOptions\>\) Constructor {#Abblix.Oidc.Server.Mvc.Features.SessionManagement.CheckSessionResponseCache.CheckSessionResponseCache(Microsoft.Extensions.Options.IOptions_Microsoft.Extensions.Caching.Memory.MemoryCacheOptions_)}

Represents a cache for storing and retrieving CheckSession responses asynchronously\.

```csharp
public CheckSessionResponseCache(Microsoft.Extensions.Options.IOptions<Microsoft.Extensions.Caching.Memory.MemoryCacheOptions> cacheOptions);
```
#### Parameters

###### `cacheOptions` [Microsoft\.Extensions\.Options\.IOptions&lt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1')[Microsoft\.Extensions\.Caching\.Memory\.MemoryCacheOptions](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.caching.memory.memorycacheoptions 'Microsoft\.Extensions\.Caching\.Memory\.MemoryCacheOptions')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.options.ioptions-1 'Microsoft\.Extensions\.Options\.IOptions\`1') {#Abblix.Oidc.Server.Mvc.Features.SessionManagement.CheckSessionResponseCache.CheckSessionResponseCache(Microsoft.Extensions.Options.IOptions_Microsoft.Extensions.Caching.Memory.MemoryCacheOptions_).cacheOptions}

The options to configure the memory cache\.

### Remarks
This cache is used to store CheckSession responses for quick retrieval, reducing the need to recompute them
for the same input key\.
### Methods

## CheckSessionResponseCache\.GetOrAddAsync\(object, Func\<Task\<ActionResult\>\>\) Method {#Abblix.Oidc.Server.Mvc.Features.SessionManagement.CheckSessionResponseCache.GetOrAddAsync(object,System.Func_System.Threading.Tasks.Task_Microsoft.AspNetCore.Mvc.ActionResult__)}

Gets an ActionResult from the cache with the specified key, or adds it to the cache if not present\.

```csharp
public System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult> GetOrAddAsync(object key, System.Func<System.Threading.Tasks.Task<Microsoft.AspNetCore.Mvc.ActionResult>> factory);
```
#### Parameters

###### `key` [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') {#Abblix.Oidc.Server.Mvc.Features.SessionManagement.CheckSessionResponseCache.GetOrAddAsync(object,System.Func_System.Threading.Tasks.Task_Microsoft.AspNetCore.Mvc.ActionResult__).key}

The key used to identify the item in the cache\.

###### `factory` [System\.Func&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-1 'System\.Func\`1')[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.func-1 'System\.Func\`1') {#Abblix.Oidc.Server.Mvc.Features.SessionManagement.CheckSessionResponseCache.GetOrAddAsync(object,System.Func_System.Threading.Tasks.Task_Microsoft.AspNetCore.Mvc.ActionResult__).factory}

A delegate that provides the ActionResult to be added to the cache if it doesn't exist\.

Implements [GetOrAddAsync\(object, Func&lt;Task&lt;ActionResult&gt;&gt;\)](https://www.abblix.com/en/docs/api/abblix-oidc-server-mvc/Abblix.Oidc.Server.Mvc.Features.SessionManagement.ICheckSessionResponseCache#Abblix.Oidc.Server.Mvc.Features.SessionManagement.ICheckSessionResponseCache.GetOrAddAsync(object,System.Func_System.Threading.Tasks.Task_Microsoft.AspNetCore.Mvc.ActionResult__) 'Abblix\.Oidc\.Server\.Mvc\.Features\.SessionManagement\.ICheckSessionResponseCache\.GetOrAddAsync\(object, System\.Func\<System\.Threading\.Tasks\.Task\<Microsoft\.AspNetCore\.Mvc\.ActionResult\>\>\)')

#### Returns
[System\.Threading\.Tasks\.Task&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')[Microsoft\.AspNetCore\.Mvc\.ActionResult](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.actionresult 'Microsoft\.AspNetCore\.Mvc\.ActionResult')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1')  
A [System\.Threading\.Tasks\.Task&lt;&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.task-1 'System\.Threading\.Tasks\.Task\`1') representing the asynchronous operation\. The task result contains
the cached or newly generated ActionResult\.
