TestimoX

API Reference

Class

JsonStreamExporter

Namespace TestimoX.Reporting.Json
Assembly TestimoX
Modifiers static

Streaming JSON exporter to avoid materializing large datasets in memory.

Inheritance

  • Object
  • JsonStreamExporter

Methods

public static async Task ExportArrayAsync<T>(String path, IEnumerable<T> items, JsonTypeInfo<T> typeInfo, CancellationToken ct = null) #
Returns: Task

Writes an array of items to a JSON file using a streaming writer.

Type Parameters

T

Parameters

path System.String requiredposition: 0
Destination file path. Created if it does not exist.
items System.Collections.Generic.IEnumerable{System.Object} requiredposition: 1
Enumerable of items to serialize.
ct System.Threading.CancellationToken = null requiredposition: 2
Optional cancellation token.
options System.Text.Json.JsonSerializerOptions = null optionalposition: 3
Optional serializer options (defaults to non-indented).
ExportArrayAsync``1 2 overloads
ExportArrayAsync``1(System.String path, System.Collections.Generic.IAsyncEnumerable{``0} items, System.Threading.CancellationToken ct, System.Text.Json.JsonSerializerOptions options) #

Writes an async sequence of items to a JSON file as a top-level array.

Parameters

path System.String required
Destination file path. Created if it does not exist.
items System.Collections.Generic.IAsyncEnumerable{``0} required
Async sequence to serialize.
ct System.Threading.CancellationToken required
Optional cancellation token.
options System.Text.Json.JsonSerializerOptions required
Optional serializer options (defaults to non-indented).
ExportArrayAsync``1(System.String arg1, System.Collections.Generic.IEnumerable{``0} arg2, System.Text.Json.Serialization.Metadata.JsonTypeInfo{``0} arg3, System.Threading.CancellationToken arg4) #

Typed streaming export using a source-generated JsonTypeInfo for AOT safety.

Parameters

arg1 System.String required
arg2 System.Collections.Generic.IEnumerable{``0} required
arg3 System.Text.Json.Serialization.Metadata.JsonTypeInfo{``0} required
arg4 System.Threading.CancellationToken required