#### [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')

## ICheckSessionResponseCache Interface

Represents a cache for storing and retrieving Check Session response data\.

```csharp
public interface ICheckSessionResponseCache
```

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

## ICheckSessionResponseCache\.GetOrAddAsync\(object, Func\<Task\<ActionResult\>\>\) Method {#Abblix.Oidc.Server.Mvc.Features.SessionManagement.ICheckSessionResponseCache.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
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.ICheckSessionResponseCache.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.ICheckSessionResponseCache.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\.

#### 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\.
