microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
feature/oauthflow-fixes

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

core/src/Microsoft.Teams.Apps/State/TurnStateOptions.cs

28lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4using Microsoft.Extensions.Caching.Distributed;
5
6namespace Microsoft.Teams.Apps.State;
7
8/// <summary>
9/// Configuration options for turn state management.
10/// </summary>
11public class TurnStateOptions
12{
13 /// <summary>
14 /// Gets or sets the cache entry options applied when saving state.
15 /// Defaults to a 1-hour sliding expiration.
16 /// </summary>
17 public DistributedCacheEntryOptions CacheEntryOptions { get; set; } = new()
18 {
19 SlidingExpiration = TimeSpan.FromHours(1)
20 };
21
22 /// <summary>
23 /// Gets or sets the prefix for cache keys.
24 /// Defaults to <c>"ts"</c>. Change this to isolate state when multiple bots share the same cache.
25 /// Keys are formatted as <c>{KeyPrefix}:conv:{conversationId}</c> and <c>{KeyPrefix}:user:{conversationId}:{userId}</c>.
26 /// </summary>
27 public string KeyPrefix { get; set; } = "ts";
28}
29