dotnet/AspNetCore.Docs

How to Get/Set A Type Not byte[]

Ouverte

#16 031 ouverte le 4 déc. 2019

 (8 commentaires) (0 réaction) (0 personne assignée)C# (24 791 forks)batch import
Help wantedcode help wanteddoc-enhancement

Métriques du dépôt

Stars
 (13 093 étoiles)
Métriques de merge PR
 (Merge moyen 2j 17h) (49 PRs mergées en 30 j)

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.

Guide contributeur