microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
feat/msal

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Common/Storage/Storage.cs

26lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4namespace Microsoft.Teams.Common.Storage;
5
6/// <summary>
7/// a storage container that can get/set/delete items by a unique key
8/// </summary>
9/// <typeparam name="TKey">the key type</typeparam>
10/// <typeparam name="TValue">the value type</typeparam>
11public interface IStorage<TKey, TValue> where TKey : notnull
12{
13 public bool Exists(TKey key);
14 public Task<bool> ExistsAsync(TKey key);
15
16 public TValue? Get(TKey key);
17 public T? Get<T>(TKey key) where T : TValue;
18 public Task<TValue?> GetAsync(TKey key);
19 public Task<T?> GetAsync<T>(TKey key) where T : TValue;
20
21 public void Set(TKey key, TValue value);
22 public Task SetAsync(TKey key, TValue value);
23
24 public void Delete(TKey key);
25 public Task DeleteAsync(TKey key);
26}