C# Класс ExoModel.ETL.ModelTranslator

Translates from one ModelType to another using a set of property translation expressions.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CreatePropertyTranslator PropertyTranslator
EnsureDestinationInstance bool

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

AddPropertyTranslation() публичный Метод

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
Результат void

AddPropertyTranslation() публичный Метод

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
Результат void

AddPropertyTranslation() публичный Метод

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
Результат void

ModelTranslator() публичный Метод

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
Результат System

Translate() публичный Метод

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.
Результат IEnumerable

Translate() публичный Метод

Translates the specified instance of the source type into the destination type.
public Translate ( ModelInstance source ) : ModelInstance
source ModelInstance
Результат ModelInstance