dotnet/AspNetCore.Docs

How to Get/Set A Type Not byte[]

開放

#16,031 建立於 2019年12月4日

 (8 則留言) (0 個反應) (0 位負責人)C# (24,791 個分叉)batch import
Help wantedcode help wanteddoc-enhancement

倉庫指標

星標
 (13,093 顆星)
PR 合併指標
 (平均合併 2天 17小時) (30 天內合併 49 個 PR)

描述

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.

貢獻者指南