 | 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.WikibaseAssembly: WikiClientLibrary.Wikibase (in WikiClientLibrary.Wikibase.dll) Version: 0.9.0-int.4+fbadc980737ddc9bb67116900ecad57f84a0b241
Syntaxpublic static IAsyncEnumerable<SerializableEntity?> LoadAllAsync(
Stream s
)
Public Shared Function LoadAllAsync (
s As Stream
) As IAsyncEnumerable(Of SerializableEntity)
Dim s As Stream
Dim returnValue As IAsyncEnumerable(Of SerializableEntity)
returnValue = SerializableEntity.LoadAllAsync(s)
public:
static IAsyncEnumerable<SerializableEntity^>^ LoadAllAsync(
Stream^ s
)
static member LoadAllAsync :
s : Stream -> IAsyncEnumerable<SerializableEntity> 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| Exception | Condition |
|---|
| JsonException | The stream does not contain a JSON array of objects; OR there is extraneous content after the root JSON array. |
RemarksThis 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