1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
using System . Text . Json ;
2
2
3
+ using Fido2NetLib . Serialization ;
4
+
3
5
using Microsoft . Extensions . Caching . Distributed ;
4
6
using Microsoft . Extensions . Caching . Memory ;
5
7
using Microsoft . Extensions . Internal ;
@@ -103,7 +105,7 @@ protected virtual async Task StoreDistributedCachedBlob(IMetadataRepository repo
103
105
{
104
106
await _distributedCache . SetStringAsync (
105
107
GetBlobCacheKey ( repository ) ,
106
- JsonSerializer . Serialize ( payload ) ,
108
+ JsonSerializer . Serialize ( payload , FidoModelSerializerContext . Default . MetadataBLOBPayload ) ,
107
109
new DistributedCacheEntryOptions ( )
108
110
{
109
111
AbsoluteExpiration = GetDistributedCacheAbsoluteExpiryTime ( GetNextUpdateTimeFromPayload ( payload ) )
@@ -120,7 +122,7 @@ protected virtual async Task<MetadataBLOBPayload> GetDistributedCachedBlob(IMeta
120
122
{
121
123
try
122
124
{
123
- var cachedBlob = JsonSerializer . Deserialize < MetadataBLOBPayload > ( distributedCacheEntry ) ;
125
+ var cachedBlob = JsonSerializer . Deserialize ( distributedCacheEntry , FidoModelSerializerContext . Default . MetadataBLOBPayload ) ;
124
126
var nextUpdateTime = GetNextUpdateTimeFromPayload ( cachedBlob ) ;
125
127
126
128
//If the cache until time is in the past then update and return new data, otherwise return the cached value
0 commit comments