Skip to content

Pact Cache DualLayerCacheService Set T (string T Microsoft Extensions Caching Distributed DistributedCacheEntryOptions System Text Json JsonSerializerOptions)

welshronaldo edited this page May 30, 2022 · 4 revisions

DualLayerCacheService.Set<T>(string, T, DistributedCacheEntryOptions, JsonSerializerOptions) Method

Convert a reference type to a json string and store it against the specified key

public override T Set<T>(string key, T value, Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions options, System.Text.Json.JsonSerializerOptions jsonOptions=null)
    where T : class;

Type parameters

T

Parameters

key System.String

value T

options Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions

jsonOptions System.Text.Json.JsonSerializerOptions
Optional options to override the default STJ ones

Returns

T

Implements Set(string, T, DistributedCacheEntryOptions, JsonSerializerOptions)

Remarks

Internally serializes to JSON

Clone this wiki locally