Class EtlPipelineXmlSinkExtensions

Namespace
Wolfgang.Etl.Xml
Assembly
Wolfgang.Etl.Xml.dll

Class-named XML sink terminators for the fluent Wolfgang.Etl.Abstractions.EtlPipeline chain. Each terminator constructs the matching loader and terminates the pipeline, enabling … .XmlSingleStreamLoader<Person>("people.xml").

public static class EtlPipelineXmlSinkExtensions
Inheritance
EtlPipelineXmlSinkExtensions
Inherited Members

Remarks

Path-based terminators own the file stream they create and close it after the run completes (success or failure). Stream-based terminators do not close the stream — the caller owns it (respecting LeaveOpen).

Methods

XmlMultiStreamLoader<T>(IEtlPipeline<T>, Func<T, Stream>)

Terminates the pipeline, writing one XML document per record to a stream chosen per record. The loader closes each stream after writing its record.

public static IEtlPipelineSink XmlMultiStreamLoader<T>(this IEtlPipeline<T> pipeline, Func<T, Stream> streamFactory) where T : notnull, new()

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

streamFactory Func<T, Stream>

A factory that receives each record and returns the stream to write it to. The loader disposes the returned stream after writing.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or streamFactory is null.

XmlSingleStreamLoader<T>(IEtlPipeline<T>, Stream, XmlSingleStreamLoaderOptions?)

Terminates the pipeline, writing all records as a single-root XML document to a stream. The caller owns the stream.

public static IEtlPipelineSink XmlSingleStreamLoader<T>(this IEtlPipeline<T> pipeline, Stream stream, XmlSingleStreamLoaderOptions? options = null) where T : notnull, new()

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

stream Stream

The stream to write the XML document to.

options XmlSingleStreamLoaderOptions

Optional loader options. When null, defaults are used.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or stream is null.

XmlSingleStreamLoader<T>(IEtlPipeline<T>, string, XmlSingleStreamLoaderOptions?)

Terminates the pipeline, writing all records as a single-root XML document to a file. The factory owns the file stream and closes it after the run.

public static IEtlPipelineSink XmlSingleStreamLoader<T>(this IEtlPipeline<T> pipeline, string path, XmlSingleStreamLoaderOptions? options = null) where T : notnull, new()

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

path string

The path of the XML file to write.

options XmlSingleStreamLoaderOptions

Optional loader options. When null, defaults are used.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or path is null.