microsoft/teams.net

Public

mirrored fromhttps://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 · modepreview

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

namespace Microsoft.Teams.Common.Storage;

/// <summary>
/// a storage container that can get/set/delete items by a unique key
/// </summary>
/// <typeparam name="TKey">the key type</typeparam>
/// <typeparam name="TValue">the value type</typeparam>
public interface IStorage<TKey, TValue> where TKey : notnull
{
    public bool Exists(TKey key);
    public Task<bool> ExistsAsync(TKey key);

    public TValue? Get(TKey key);
    public T? Get<T>(TKey key) where T : TValue;
    public Task<TValue?> GetAsync(TKey key);
    public Task<T?> GetAsync<T>(TKey key) where T : TValue;

    public void Set(TKey key, TValue value);
    public Task SetAsync(TKey key, TValue value);

    public void Delete(TKey key);
    public Task DeleteAsync(TKey key);
}