Class JsonSource<TOutput>
Reads data from a json source. This can be any http resource or a file. By default, data is pulled via httpclient. Use the ResourceType property to read data from a file.
Inheritance
DataFlowSource<TOutput>
DataFlowExecutableSource<TOutput>
DataFlowStreamSource<TOutput>
JsonSource<TOutput>
Inherited Members
Namespace: ETLBox.Json
Assembly: ETLBox.Json.dll
Syntax
public class JsonSource<TOutput> : DataFlowStreamSource<TOutput>, IDataFlowStreamSource<TOutput>, IDataFlowExecutableSource<TOutput>, IDataFlowSource<TOutput>, IDataFlowStreamSource, IDataFlowExecutableSource, IDataFlowSource, IDataFlowComponent, ILoggableTaskType Parameters
| Name | Description |
|---|---|
| TOutput | Type of outgoing data. |
Examples
JsonSource<POCO> source = new JsonSource<POCO>("https://jsonplaceholder.typicode.com/todos");Constructors
JsonSource()
Declaration
public JsonSource()JsonSource(string)
Declaration
public JsonSource(string uri)Parameters
| Type | Name | Description |
|---|---|---|
| string | uri | The source json file name or uri |
JsonSource(string, ResourceType)
Declaration
public JsonSource(string uri, ResourceType resourceType)Parameters
| Type | Name | Description |
|---|---|---|
| string | uri | The source json file name or uri |
| ResourceType | resourceType | Specifies if data is loaded from a file, a web endpoint or other storage types (e.g. Azure Blob Storage) |
Properties
JsonSerializer
The Newtonsoft.Json.JsonSerializer used to deserialize the json into the used data type.
Declaration
public JsonSerializer JsonSerializer { get; set; }Property Value
| Type | Description |
|---|---|
| JsonSerializer |
PropertyNameOfDataArray
By default, the first array which is encountered in the json is autmatically read. If you want a different behaviour set this to the property name of the array which you like to process.
Declaration
public string PropertyNameOfDataArray { get; set; }Property Value
| Type | Description |
|---|---|
| string |
Methods
CheckParameter()
Declaration
protected override void CheckParameter()Overrides
CloseReader()
Declaration
protected override void CloseReader()Overrides
InitReader()
Declaration
protected override void InitReader()Overrides
ReadAllRecords()
Declaration
protected override void ReadAllRecords()