public void Apply(ITransformConfigurator <TInput> configurator)
        {
            if (_transformConfigurator.TryGetConverter(out IPropertyConverter <TProperty, TProperty> converter))
            {
                var inputPropertyProvider = new InputPropertyProvider <TInput, TProperty>(_property);

                var provider = new PropertyConverterPropertyProvider <TInput, TProperty, TProperty>(converter, inputPropertyProvider);

                configurator.Set(_property, provider);
            }
        }
        public void Apply(ITransformConfigurator <TInput> configurator)
        {
            if (_transformConfigurator.TryGetConverter(out IPropertyConverter <TValue, TValue> converter))
            {
                var inputPropertyProvider = new InputPropertyProvider <TInput, TProperty>(_property);

                var dictionaryConverter = new DictionaryPropertyConverter <TKey, TValue, TValue>(converter) as IPropertyConverter <TProperty, TProperty>;

                var provider = new PropertyConverterPropertyProvider <TInput, TProperty, TProperty>(dictionaryConverter, inputPropertyProvider);

                configurator.Set(_property, provider);
            }
        }
Example #3
0
        public void Apply(ITransformConfigurator <TInput> configurator)
        {
            if (_transformConfigurator.TryGetConverter(out IPropertyConverter <TElement, TElement> converter))
            {
                var inputPropertyProvider = new InputPropertyProvider <TInput, TProperty>(_property);

                IPropertyConverter <TProperty, TProperty> arrayConverter = typeof(TProperty).IsArray
                    ? new ArrayPropertyConverter <TElement, TElement>(converter) as IPropertyConverter <TProperty, TProperty>
                    : new ListPropertyConverter <TElement, TElement>(converter) as IPropertyConverter <TProperty, TProperty>;

                var provider = new PropertyConverterPropertyProvider <TInput, TProperty, TProperty>(arrayConverter, inputPropertyProvider);

                configurator.Set(_property, provider);
            }
        }