Skip to content

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

welshronaldo edited this page May 30, 2022 · 4 revisions

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

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

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

Type parameters

T

Parameters

key System.String

factory System.Func<Microsoft.Extensions.Caching.Distributed.DistributedCacheEntryOptions,T>

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

Returns

T

Remarks

Internally serializes to JSON

Clone this wiki locally