Class DataConversionContextBuilder
A data conversion context builder.
Inheritance
Inherited Members
Namespace: Kephas.Data.Conversion
Assembly: Kephas.Data.dll
Syntax
public class DataConversionContextBuilder
Constructors
| Improve this Doc View SourceDataConversionContextBuilder(IDataConversionContext)
Initializes a new instance of the DataConversionContextBuilder class.
Declaration
public DataConversionContextBuilder(IDataConversionContext conversionContext)
Parameters
Type | Name | Description |
---|---|---|
IDataConversionContext | conversionContext | Context for the data conversion. |
DataConversionContextBuilder(IDataSpace, IDataConversionService)
Initializes a new instance of the DataConversionContextBuilder class.
Declaration
public DataConversionContextBuilder(IDataSpace dataSpace, IDataConversionService conversionService)
Parameters
Type | Name | Description |
---|---|---|
IDataSpace | dataSpace | The data space. |
IDataConversionService | conversionService | The data conversion service. |
Properties
| Improve this Doc View SourceConversionContext
Gets a context for the conversion.
Declaration
public IDataConversionContext ConversionContext { get; }
Property Value
Type | Description |
---|---|
IDataConversionContext | The conversion context. |
Methods
| Improve this Doc View SourceMerge(IDataConversionContext)
Merges the provided data conversion context into the existing one, overwriting the values.
Declaration
public DataConversionContextBuilder Merge(IDataConversionContext dataConversionContext)
Parameters
Type | Name | Description |
---|---|---|
IDataConversionContext | dataConversionContext | The source context for the data conversion. |
Returns
Type | Description |
---|---|
DataConversionContextBuilder |
ThrowOnError(Boolean)
Sets a value indicating whether the conversion should throw an exception on error, or swallow them.
Declaration
public DataConversionContextBuilder ThrowOnError(bool throwOnError = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | throwOnError | True to throw on error, false to swallow the errors (optional). Default is |
Returns
Type | Description |
---|---|
DataConversionContextBuilder |
WithRootSourceType(Type)
Uses the provided type for the source root object if the conversion needs to identify it.
Declaration
public DataConversionContextBuilder WithRootSourceType(Type rootSourceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | rootSourceType | The type of the source root object. |
Returns
Type | Description |
---|---|
DataConversionContextBuilder |
WithRootTargetType(Type)
Uses the provided type for the target root object if the conversion needs to create or identify it.
Declaration
public DataConversionContextBuilder WithRootTargetType(Type rootTargetType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | rootTargetType | The type of the target root object. |
Returns
Type | Description |
---|---|
DataConversionContextBuilder |