Exemplo n.º 1
0
        public override void Apply(IEntityTranslatorBuilder <TResult, TInput, TSchema> builder)
        {
            var translator = new SetPropertyTranslator <TResult, TProperty, TInput, TSchema>(builder.ImplementationType, ResultPropertyInfo,
                                                                                             new StaticTranslatePropertyProvider <TProperty, TInput, TSchema>(_propertyValue));

            builder.Add(ResultPropertyInfo.Name, translator);
        }
Exemplo n.º 2
0
        public override void Apply(IEntityTranslatorBuilder <TResult, TInput, TSchema> builder)
        {
            IEntityTranslator <TEntity, TSchema> entityTranslator = builder.GetEntityTranslator <TEntity, TEntity, TTranslation>();

            var translator = new TranslateEntityValuePropertyTranslator <TResult, TEntity, TInput, TSchema>(builder.ImplementationType, ResultPropertyInfo, InputPropertyInfo,
                                                                                                            entityTranslator);

            builder.Add(ResultPropertyInfo.Name, translator);
        }
Exemplo n.º 3
0
        /// <summary>
        ///     Replace all existing translators for the property with the specified translator
        /// </summary>
        /// <param name="builder"></param>
        /// <param name="propertyName"></param>
        /// <param name="translator"></param>
        /// <typeparam name="TResult"></typeparam>
        /// <typeparam name="TInput"></typeparam>
        /// <typeparam name="TSchema"></typeparam>
        public static void Replace <TResult, TInput, TSchema>(this IEntityTranslatorBuilder <TResult, TInput, TSchema> builder, string propertyName,
                                                              IPropertyTranslator <TResult, TInput, TSchema> translator)
            where TResult : TSchema
            where TInput : TSchema
            where TSchema : Entity
        {
            builder.Clear(propertyName);

            builder.Add(propertyName, translator);
        }
Exemplo n.º 4
0
        public override void Apply(IEntityTranslatorBuilder <TResult, TInput, TSchema> builder)
        {
            var translator = new CopyValueListPropertyTranslator <TResult, TValue, TInput, TSchema>(builder.ImplementationType, ResultPropertyInfo, InputPropertyInfo);

            builder.Add(ResultPropertyInfo.Name, translator);
        }
Exemplo n.º 5
0
        public void Apply(IEntityTranslatorBuilder <TResult, TInput, TSchema> builder)
        {
            var translator = new ExcludeValuePropertyTranslator <TResult, TValue, TInput, TSchema>(builder.ImplementationType, _property);

            builder.Add(_property.Name, translator);
        }