Пример #1
0
        private Task <bool> streamJsonById <T, TId>(TId id, Stream destination, CancellationToken token) where T : class where TId : notnull
        {
            var storage = _session.QueryStorageFor <T, TId>();
            var command = storage.BuildLoadCommand(id, _session.TenantId);

            return(_session.StreamOne(command, destination, token));
        }
Пример #2
0
        private async Task <bool> streamJsonById <T, TId>(TId id, Stream destination, CancellationToken token) where T : class where TId : notnull
        {
            await _session.Database.EnsureStorageExistsAsync(typeof(T), token).ConfigureAwait(false);

            var storage = _session.QueryStorageFor <T, TId>();
            var command = storage.BuildLoadCommand(id, _session.TenantId);

            return(await _session.StreamOne(command, destination, token).ConfigureAwait(false));
        }