C# Class ExoModel.ETL.ModelTranslator

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

Private Properties

Свойство Type Description
CreatePropertyTranslator PropertyTranslator
EnsureDestinationInstance bool

Méthodes publiques

Méthode 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

Méthode 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 méthode

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
Résultat void

AddPropertyTranslation() public méthode

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
Résultat void

AddPropertyTranslation() public méthode

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
Résultat void

ModelTranslator() public méthode

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
Résultat System

Translate() public méthode

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.
Résultat IEnumerable

Translate() public méthode

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