Пример #1
0
        static void AddAdapter <T>(ConverterManager cm, ICloudBlobStreamBinder <T> x)
        {
            cm.AddExactConverter <Stream, T>(stream => x.ReadFromStreamAsync(stream, CancellationToken.None).Result);

            cm.AddExactConverter <ApplyConversion <T, Stream>, object>(pair =>
            {
                T value       = pair.Value;
                Stream stream = pair.Existing;
                x.WriteToStreamAsync(value, stream, CancellationToken.None).Wait();
                return(null);
            });
        }