Skip to content

DiskCache supports custom serializers #450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 2, 2023
Merged

DiskCache supports custom serializers #450

merged 5 commits into from
Feb 2, 2023

Conversation

Memoyu
Copy link
Contributor

@Memoyu Memoyu commented Feb 2, 2023

Content

Then use diskcache to allow custom serializers. Currently, the following serializers are supported:

  1. NewtonsoftJson
  2. SystemTextJson
  3. Message Pack

Usage:

option.UseDisk(cfg =>
{
    cfg.DBConfig = new DiskDbOptions { BasePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Cache") };
    cfg.SerializerName = "msgpack";
}, "disk")
.WithJson("json")
.WithSystemTextJson("sysjson")
.WithMessagePack("msgpack");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants