dotnet / dotnet/AspNetCore.Docs

How to Get/Set A Type Not byte[]

Open
#16,031 8 comments 0 reactions 0 assignees View on GitHub
code help wanted doc-enhancement Help wanted
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

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
```csharp
private readonly IDistributedCache _genricCache;
private readonly IDistributedCache _cache;
public async Task Test()
{
Person person = await _genricCache.GetAsync(key);
//Or
Person person = await _cache.GetAsync(key);
}
```

@Rick-Anderson edit: Integrated issue

---
#### Document Details

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

* ID: 0d01025d-86b2-bb2d-86c1-ef0695bc98e3
* Version Independent ID: 5b9a6572-3671-0d54-b2ef-83d04f8b3e96
* Content: [Distributed caching in ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed?view=aspnetcore-3.0)
* Content Source: [aspnetcore/performance/caching/distributed.md](https://github.com/aspnet/AspNetCore.Docs/blob/master/aspnetcore/performance/caching/distributed.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-performance**
* GitHub Login: @guardrex
* Microsoft Alias: **riande**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.