public DictionaryCopyHeaderInitializer(PropertyInfo propertyInfo, string key)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException(nameof(propertyInfo));
            }

            _key            = key;
            _headerProperty = WritePropertyCache <SendContext> .GetProperty <THeader>(propertyInfo);
        }
Beispiel #2
0
        public EntityPropertyConverter(string name)
        {
            _name = name;
            _read = ReadPropertyCache <TEntity> .GetProperty <TProperty>(name);

            _write = WritePropertyCache <TEntity> .GetProperty <TProperty>(name);

            _toEntity   = EntityPropertyTypeConverter.Instance as ITypeConverter <TProperty, EntityProperty>;
            _fromEntity = EntityPropertyTypeConverter.Instance as ITypeConverter <EntityProperty, TProperty>;
        }
        public DictionaryCopyPropertyInitializer(PropertyInfo propertyInfo, string key)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException(nameof(propertyInfo));
            }

            _key             = key;
            _messageProperty = WritePropertyCache <TMessage> .GetProperty <TProperty>(propertyInfo);
        }
        public CopyHeaderInitializer(PropertyInfo headerPropertyInfo, PropertyInfo inputPropertyInfo)
        {
            if (headerPropertyInfo == null)
            {
                throw new ArgumentNullException(nameof(headerPropertyInfo));
            }

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <THeader>(inputPropertyInfo);

            _headerProperty = WritePropertyCache <SendContext> .GetProperty <THeader>(headerPropertyInfo);
        }
Beispiel #5
0
        public CopyPropertyInitializer(string messagePropertyName, string inputPropertyName = null)
        {
            if (messagePropertyName == null)
            {
                throw new ArgumentNullException(nameof(messagePropertyName));
            }

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <TProperty>(inputPropertyName ?? messagePropertyName);

            _messageProperty = WritePropertyCache <TMessage> .GetProperty <TProperty>(messagePropertyName);
        }
Beispiel #6
0
        public CopyObjectPropertyInitializer(PropertyInfo messagePropertyInfo, PropertyInfo inputPropertyInfo)
        {
            if (messagePropertyInfo == null)
            {
                throw new ArgumentNullException(nameof(messagePropertyInfo));
            }

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <TInputProperty>(inputPropertyInfo);

            _messageProperty = WritePropertyCache <TMessage> .GetProperty <object>(messagePropertyInfo);
        }
        public CopyMessageHeaderInitializer(string headerName, string inputPropertyName = null)
        {
            if (headerName == null)
            {
                throw new ArgumentNullException(nameof(headerName));
            }

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <THeader>(inputPropertyName ?? headerName);

            _headerProperty = WritePropertyCache <SendContext <TMessage> > .GetProperty <THeader>(headerName);
        }
Beispiel #8
0
        public ConvertMessagePropertyInitializer(IPropertyTypeConverter <TProperty, TInputProperty> converter, string messagePropertyName,
                                                 string inputPropertyName = null)
        {
            if (messagePropertyName == null)
            {
                throw new ArgumentNullException(nameof(messagePropertyName));
            }

            _converter = converter;

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <TInputProperty>(inputPropertyName ?? messagePropertyName);

            _messageProperty = WritePropertyCache <TMessage> .GetProperty <TProperty>(messagePropertyName);
        }
Beispiel #9
0
        public ProviderPropertyInitializer(IPropertyProvider <TInput, TProperty> propertyProvider, PropertyInfo propertyInfo)
        {
            if (propertyProvider == null)
            {
                throw new ArgumentNullException(nameof(propertyProvider));
            }

            if (propertyInfo == null)
            {
                throw new ArgumentNullException(nameof(propertyInfo));
            }

            _propertyProvider = propertyProvider;

            _messageProperty = WritePropertyCache <TMessage> .GetProperty <TProperty>(propertyInfo);
        }
Beispiel #10
0
        public ProviderHeaderInitializer(IPropertyProvider <TInput, TProperty> propertyProvider, string propertyName)
        {
            if (propertyProvider == null)
            {
                throw new ArgumentNullException(nameof(propertyProvider));
            }

            if (propertyName == null)
            {
                throw new ArgumentNullException(nameof(propertyName));
            }

            _propertyProvider = propertyProvider;

            _messageProperty = WritePropertyCache <SendContext> .GetProperty <TProperty>(propertyName);
        }