dotnet/AspNetCore.Docs

How to Get/Set A Type Not byte[]

Aberta

#16.031 aberto em 4 de dez. de 2019

 (8 comentários) (0 reação) (0 responsável)C# (24.791 forks)batch import
Help wantedcode help wanteddoc-enhancement

Métricas do repositório

Stars
 (13.093 estrelas)
Métricas de merge de PR
 (Mesclagem média 2d 17h) (49 fundiu PRs em 30d)

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.

Guia do colaborador