コード例 #1
0
        public DictionaryCopyHeaderInitializer(PropertyInfo propertyInfo, string key)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException(nameof(propertyInfo));
            }

            _key            = key;
            _headerProperty = WritePropertyCache <SendContext> .GetProperty <THeader>(propertyInfo);
        }
コード例 #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>;
        }
コード例 #3
0
        public DictionaryCopyPropertyInitializer(PropertyInfo propertyInfo, string key)
        {
            if (propertyInfo == null)
            {
                throw new ArgumentNullException(nameof(propertyInfo));
            }

            _key             = key;
            _messageProperty = WritePropertyCache <TMessage> .GetProperty <TProperty>(propertyInfo);
        }
コード例 #4
0
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #7
0
        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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }