InMemoryConversationStore Class

An IConversationStore that keeps the conversations in memory for the lifetime of the application. Registered by IServiceCollection) when no other store is registered.

Inheritance

Object

InMemoryConversationStore

Namespace: Radzen

Assembly: Radzen.Blazor.dll

Syntax

public class InMemoryConversationStore : IConversationStore

Constructors

InMemoryConversationStoreLink to this section

An IConversationStore that keeps the conversations in memory for the lifetime of the application. Registered by IServiceCollection) when no other store is registered.

Declaration
public InMemoryConversationStore()

Properties

MaxAgeLink to this section

Gets or sets the age after which a conversation is removed when another one is saved. Default is 24 hours; null keeps them forever.

Declaration
public TimeSpan? MaxAge { get; set; }
Property Value
Type Description
TimeSpan?Gets or sets the age after which a conversation is removed when another one is saved. Default is 24 hours; null keeps them forever.

Methods

DeleteAsyncLink to this section

Declaration
public Task DeleteAsync(string sessionId, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
string sessionId
Threading.CancellationToken cancellationToken
Returns
Type Description
Task

ListAsyncLink to this section

Declaration
public Task<IReadOnlyList<ConversationSession>> ListAsync(string userId, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
string userId
Threading.CancellationToken cancellationToken
Returns
Type Description
Task<IReadOnlyList<ConversationSession>>

LoadAsyncLink to this section

Declaration
public Task<ConversationSession> LoadAsync(string sessionId, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
string sessionId
Threading.CancellationToken cancellationToken
Returns
Type Description
Task<ConversationSession>

SaveAsyncLink to this section

Declaration
public Task SaveAsync(ConversationSession session, Threading.CancellationToken cancellationToken)
Parameters
Type Name Description
ConversationSession session
Threading.CancellationToken cancellationToken
Returns
Type Description
Task
An error has occurred. This app may no longer respond until reloaded. Reload 🗙