Пример #1
0
        public IAsyncDisposable InitializeAsync(DatabaseSmugglerOptionsServerSide options, SmugglerResult result, long buildVersion)
        {
            _gzipStream = new GZipStream(_stream, CompressionMode.Compress, leaveOpen: true);
            _writer     = new AsyncBlittableJsonTextWriter(_context, _gzipStream);
            _options    = options;

            SetupMetadataFilterMethod(_context);

            _writer.WriteStartObject();

            _writer.WritePropertyName("BuildVersion");
            _writer.WriteInteger(buildVersion);

            return(new AsyncDisposableAction(async() =>
            {
                _writer.WriteEndObject();
                await _writer.DisposeAsync();
                await _gzipStream.DisposeAsync();
            }));
        }
Пример #2
0
 public ValueTask DisposeAsync()
 {
     return(_writer.DisposeAsync());
 }