Click or drag to resize

SerializableEntityLoadAllAsync Method

This is preliminary documentation and is subject to change.

Asynchronously enumerates a JSON array of the serialized Wikibase entities contained in the specified stream.

Namespace: WikiClientLibrary.Wikibase
Assembly: WikiClientLibrary.Wikibase (in WikiClientLibrary.Wikibase.dll) Version: 0.9.0-int.4+fbadc980737ddc9bb67116900ecad57f84a0b241
Syntax
public static IAsyncEnumerable<SerializableEntity?> LoadAllAsync(
	Stream s
)

Parameters

s  Stream
The stream from which to read serialized entity JSON.

Return Value

IAsyncEnumerableSerializableEntity
A sequence that, when enumerated asynchronously, will read a JSON array from the stream, and parses it into a sequence of SerializableEntitys. If there is null in the JSON array, null will be enumerated in the sequence.
Exceptions
ExceptionCondition
JsonExceptionThe stream does not contain a JSON array of objects; OR there is extraneous content after the root JSON array.
Remarks

This method is recommended when you are working with a large JSON dump of Wikibase entities, because it only put the current enumerated entity in the memory. Still, you can use ToListAsyncTSource(IAsyncEnumerableTSource, CancellationToken) to materialize all the entities at once.

Due to the buffering mechanism of the implementation, if you stopped enumeration at the middle of the returned sequence, s may stop at a point later than the last deserialized JSON array item (JSON object).

Unlike other [!:overloads:Load] overloads, this method returns empty sequence if s does not contain any content.

See Also