예제 #1
0
    public static Task Set <T>(this IKeyValueStore keyValueStore,
                               string key, T value, Moment?expiresAt, CancellationToken cancellationToken = default)
    {
        var sValue = NewtonsoftJsonSerialized.New(value).Data;

        return(keyValueStore.Set(key, sValue, expiresAt, cancellationToken));
    }
예제 #2
0
 public NewtonsoftJsonSerializedToStringValueConverter(ConverterMappingHints?mappingHints = null)
     : base(
         v => v.Data,
         v => NewtonsoftJsonSerialized.New <T>(v),
         mappingHints)
 {
 }
예제 #3
0
        public static T PassThroughSystemJsonSerialized <T>(this T value, ITestOutputHelper?output = null)
        {
            var v1 = SystemJsonSerialized.New(value);

            output?.WriteLine($"SystemJsonSerialized: {v1.Data}");
            var v2 = NewtonsoftJsonSerialized.New <T>(v1.Data);

            return(v2.Value);
        }
예제 #4
0
 protected virtual string Serialize(PluginSetInfo source)
 => NewtonsoftJsonSerialized.New(source).Data;