microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
dev

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

26lines · modeblame

82a4e3c3Rajan12 months ago1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
73e7847aAlex Acebo1 years ago4namespace 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{
13public bool Exists(TKey key);
14public Task<bool> ExistsAsync(TKey key);
15
16public TValue? Get(TKey key);
17public T? Get<T>(TKey key) where T : TValue;
18public Task<TValue?> GetAsync(TKey key);
19public Task<T?> GetAsync<T>(TKey key) where T : TValue;
20
21public void Set(TKey key, TValue value);
22public Task SetAsync(TKey key, TValue value);
23
24public void Delete(TKey key);
25public Task DeleteAsync(TKey key);
26}