dotnet/AspNetCore.Docs

How to Get/Set A Type Not byte[]

Open

#16,031 opened on Dec 4, 2019

View on GitHub
 (8 comments) (0 reactions) (0 assignees)C# (13,093 stars) (24,791 forks)batch import
Help wantedcode help wanteddoc-enhancement

Description

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.

Contributor guide

How to Get/Set A Type Not byte[] · dotnet/AspNetCore.Docs#16031 | Good First Issue