File tree 8 files changed +50
-5
lines changed 8 files changed +50
-5
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ EasyCaching is an open source caching library that contains basic usages and som
36
36
| EasyCaching.ResponseCaching | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.ResponseCaching.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.ResponseCaching.svg )
37
37
| EasyCaching.Disk | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.Disk.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.Disk.svg )
38
38
| EasyCaching.LiteDB | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.LiteDB.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.LiteDB.svg )
39
+ | EasyCaching.Serialization.SystemTextJson | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.Serialization.SystemTextJson.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.Serialization.SystemTextJson.svg )
39
40
40
41
## Basic Usages
41
42
@@ -153,7 +154,7 @@ See [sample](https://github.com/catcherwong/EasyCaching/tree/master/sample)
153
154
154
155
## Todo List
155
156
156
- See [ ToDo List] ( ToDoList.md )
157
+ See [ ToDo List] ( docs/ ToDoList.md)
157
158
158
159
## Contributing
159
160
Original file line number Diff line number Diff line change 32
32
2 . MessagePack
33
33
3 . Json
34
34
4 . Protobuf
35
+ 5 . System.Text.Json
35
36
- ResponseCaching for ASP.NET Core
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ # DefaultJsonSerializer
2
+
3
+ DefaultJsonSerializer is a serializer based on ** System.Text.Json** .
4
+
5
+ # How to Use?
6
+
7
+ ## Install the package via Nuget
8
+
9
+ ```
10
+ Install-Package EasyCaching.Serialization.SystemTextJson
11
+ ```
12
+
13
+ ## Configuration
14
+
15
+ ```
16
+ public class Startup
17
+ {
18
+ //others...
19
+
20
+ public void ConfigureServices(IServiceCollection services)
21
+ {
22
+ services.AddMvc();
23
+
24
+ services.AddEasyCaching(options =>
25
+ {
26
+ // with a default name [json]
27
+ options.WithSystemTextJson();
28
+
29
+ // with a custom name [myname]
30
+ options.WithSystemTextJson("myname");
31
+
32
+ // add some serialization settings
33
+ Action<EasyCachingJsonSerializerOptions> easycaching = x =>
34
+ {
35
+
36
+ };
37
+ options.WithSystemTextJson(easycaching, "easycaching_setting");
38
+ });
39
+ }
40
+ }
41
+ ```
Original file line number Diff line number Diff line change 36
36
- [x] MessagePack
37
37
- [x] Json
38
38
- [x] ProtoBuf
39
+ - [x] System.Text.Json
39
40
- [ ] Others...
40
41
41
42
## Caching Interceptor
Original file line number Diff line number Diff line change @@ -28,4 +28,5 @@ EasyCaching is an open source caching library that contains basic usages and som
28
28
| EasyCaching.Bus.CSRedis | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.Bus.CSRedis.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.Bus.CSRedis.svg )
29
29
| EasyCaching.ResponseCaching | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.ResponseCaching.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.ResponseCaching.svg )
30
30
| EasyCaching.Disk | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.Disk.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.Disk.svg )
31
- | EasyCaching.LiteDB | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.LiteDB.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.LiteDB.svg )
31
+ | EasyCaching.LiteDB | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.LiteDB.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.LiteDB.svg )
32
+ | EasyCaching.Serialization.SystemTextJson | ![ ] ( https://img.shields.io/nuget/v/EasyCaching.Serialization.SystemTextJson.svg ) | ![ ] ( https://img.shields.io/nuget/dt/EasyCaching.Serialization.SystemTextJson.svg )
Original file line number Diff line number Diff line change 28
28
- Overview : SerializerOverview.md
29
29
- BinaryFormatter : BinaryFormatter.md
30
30
- MessagePack : MessagePack.md
31
- - Json : Json.md
31
+ - NewtonsoftJson : NewtonsoftJson.md
32
+ - SystemTextJson : SystemTextJson.md
32
33
- Protobuf : ProtoBuf.md
33
34
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public partial class DefaultSQLiteCachingProvider : EasyCachingAbstractProvider
31
31
/// <summary>
32
32
/// The cache.
33
33
/// </summary>
34
- private readonly SqliteConnection _cache ;
34
+ private SqliteConnection _cache => _dbProvider . GetConnection ( ) ;
35
35
36
36
/// <summary>
37
37
/// The cache stats.
@@ -54,7 +54,6 @@ public DefaultSQLiteCachingProvider(
54
54
this . _dbProvider = dbProviders . Single ( x => x . DBProviderName . Equals ( name ) ) ;
55
55
this . _options = options ;
56
56
this . _logger = loggerFactory ? . CreateLogger < DefaultSQLiteCachingProvider > ( ) ;
57
- this . _cache = _dbProvider . GetConnection ( ) ;
58
57
this . _cacheStats = new CacheStats ( ) ;
59
58
this . _name = name ;
60
59
You can’t perform that action at this time.
0 commit comments