C# Class ExoModel.ETL.ModelTranslator

Translates from one ModelType to another using a set of property translation expressions.
Mostrar archivo Open project: vc3/ExoModel Class Usage Examples

Private Properties

Property Type Description
CreatePropertyTranslator PropertyTranslator
EnsureDestinationInstance bool

Public Methods

Method Description
AddPropertyTranslation ( string sourceExpression, string destinationPath, string>.Func delegateConverter ) : void

Adds a value PropertyTranslator to the current ModelTranslator

AddPropertyTranslation ( string sourceExpression, string destinationPath, ModelTranslator referenceConverter ) : void

Adds a value PropertyTranslator to the current ModelTranslator.

AddPropertyTranslation ( string sourceExpression, string destinationPath, TypeConverter valueConverter = null ) : void

Adds a value PropertyTranslator to the current ModelTranslator.

ModelTranslator ( ModelType sourceType, ModelType destinationType, ModelTranslator parent = null, IEnumerable mappings = null, TypeConverter>.Func getValueConverter = null, ModelInstance>.Func createDestinationInstance = null ) : System

Creates a new ModelTranslator to support translation from the specified source ModelType to the specified destination ModelType with a specified set of property translations.

Translate ( IEnumerable sourceInstances ) : IEnumerable

Translates the specified instances of the source type into the destination type.

Translate ( ModelInstance source ) : ModelInstance

Translates the specified instance of the source type into the destination type.

Private Methods

Method Description
CreatePropertyTranslator ( string sourceExpression, string destinationPath ) : PropertyTranslator

Initializes a PropertyTranslator

EnsureDestinationInstance ( ModelInstance instance, ModelReferenceProperty property, int index ) : bool

Ensure the destination instance path is valid when nulls are encountered along the path.

Method Details

AddPropertyTranslation() public method

Adds a value PropertyTranslator to the current ModelTranslator
public AddPropertyTranslation ( string sourceExpression, string destinationPath, string>.Func delegateConverter ) : void
sourceExpression string The source expression
destinationPath string The destination path
delegateConverter string>.Func The delegate to use to generate the translated value
return void

AddPropertyTranslation() public method

Adds a value PropertyTranslator to the current ModelTranslator.
public AddPropertyTranslation ( string sourceExpression, string destinationPath, ModelTranslator referenceConverter ) : void
sourceExpression string The source expression
destinationPath string The destination path
referenceConverter ModelTranslator
return void

AddPropertyTranslation() public method

Adds a value PropertyTranslator to the current ModelTranslator.
public AddPropertyTranslation ( string sourceExpression, string destinationPath, TypeConverter valueConverter = null ) : void
sourceExpression string The source expression
destinationPath string The destination path
valueConverter System.ComponentModel.TypeConverter The optional value converter to use
return void

ModelTranslator() public method

Creates a new ModelTranslator to support translation from the specified source ModelType to the specified destination ModelType with a specified set of property translations.
public ModelTranslator ( ModelType sourceType, ModelType destinationType, ModelTranslator parent = null, IEnumerable mappings = null, TypeConverter>.Func getValueConverter = null, ModelInstance>.Func createDestinationInstance = null ) : System
sourceType ModelType
destinationType ModelType
parent ModelTranslator
mappings IEnumerable
getValueConverter TypeConverter>.Func
createDestinationInstance ModelInstance>.Func
return System

Translate() public method

Translates the specified instances of the source type into the destination type.
public Translate ( IEnumerable sourceInstances ) : IEnumerable
sourceInstances IEnumerable The list of objects created dynamically that will need to be translated.
return IEnumerable

Translate() public method

Translates the specified instance of the source type into the destination type.
public Translate ( ModelInstance source ) : ModelInstance
source ModelInstance
return ModelInstance