Table of Contents

Class JsonStringSink

Namespace
Datafication.Sinks.Connectors.JsonConnector
Assembly
Datafication.JsonConnector.dll

Transforms a DataBlock instances into a JSON string representation.

public class JsonStringSink : IDataSink<string>
Inheritance
object
JsonStringSink
Implements
IDataSink<string>

Remarks

This transformer can be used to convert structured data into a JSON format. Nested DataBlock instances will be represented as nested JSON objects.

Methods

Transform(DataBlock)

Transforms the provided collection of data records into a JSON string representation.

public Task<string> Transform(DataBlock dataBlock)

Parameters

dataBlock DataBlock

The DataBlock to transform.

Returns

Task<string>

A string representing the JSON format of the provided data records.

Remarks

The generated JSON can represent either a single JSON object or an array of objects depending on the number of records provided. If a single record is provided, a JSON object is returned. If multiple records are provided, a JSON array of objects is returned.