dotnet/AspNetCore.Docs

How to Get/Set A Type Not byte[]

オープン

#16,031 opened on 2019/12/04

 (8 件のコメント) (0 件のリアクション) (0 人の担当者)C# (24,791 件のフォーク)batch import
Help wantedcode help wanteddoc-enhancement

Repository metrics

Stars
 (13,093 個のスター)
PR merge metrics
 (平均マージ 2d 17h) (30d で 49 merged PRs)

説明

Is your feature request related to a problem? Please describe.

I Need Get/Set A Type Not byte[]

Describe the solution you'd like

private readonly IDistributedCache<Person> _genricCache;
private readonly IDistributedCache _cache;
public async Task Test()
{
    Person person = await _genricCache.GetAsync(key);
    //Or
    Person person = await _cache.GetAsync<Person>(key);
}

@Rick-Anderson edit: Integrated issue


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

コントリビューターガイド