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

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <TProperty>(propertyInfo);
        }
        public InputValuePropertyProvider(string inputPropertyName)
        {
            if (inputPropertyName == null)
            {
                throw new ArgumentNullException(nameof(inputPropertyName));
            }

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <TProperty>(inputPropertyName);
        }
Ejemplo n.º 3
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>;
        }
Ejemplo n.º 4
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);
        }
Ejemplo n.º 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);
        }
        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);
        }
        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);
        }
        public SetStringHeaderInitializer(string headerName, PropertyInfo propertyInfo)
        {
            if (headerName == null)
            {
                throw new ArgumentNullException(nameof(headerName));
            }

            _headerName = headerName;

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <string>(propertyInfo);
        }
Ejemplo n.º 9
0
        public SetHeaderInitializer(string headerName, string inputPropertyName)
        {
            if (headerName == null)
            {
                throw new ArgumentNullException(nameof(headerName));
            }

            _headerName = headerName;

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <THeader>(inputPropertyName);
        }
Ejemplo n.º 10
0
 public SourcePropertyProvider(PropertyInfo inputProperty, Func <SourceContext <TProperty, TInput>, TProperty> valueProvider)
 {
     _valueProvider = valueProvider;
     if (inputProperty != null)
     {
         _getValue = ReadPropertyCache <TInput> .GetProperty <TProperty>(inputProperty).Get;
     }
     else
     {
         _getValue = input => default;
     }
 }
Ejemplo n.º 11
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);
        }
        public bool TryGetCorrelationId(T message, out Guid?correlationId)
        {
            var correlatedByInterface = typeof(T).GetInterface <CorrelatedBy <Guid> >();

            if (correlatedByInterface != null)
            {
                var property = ReadPropertyCache <CorrelatedBy <Guid> > .GetProperty <Guid>(nameof(CorrelatedBy <Guid> .CorrelationId));

                var correlatedBy = (CorrelatedBy <Guid>)message;
                correlationId = property.Get(correlatedBy);
                return(true);
            }

            correlationId = null;
            return(false);
        }
        public PropertyConvertInputValuePropertyProvider(IPropertyConverter <TProperty, TInputProperty> converter, string inputPropertyName)
        {
            if (converter == null)
            {
                throw new ArgumentNullException(nameof(converter));
            }

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

            _converter = converter;

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <TInputProperty>(inputPropertyName);
        }
        public ConvertAsyncInputValuePropertyProvider(ITypeConverter <TProperty, TInputProperty> converter, string propertyName)
        {
            if (converter == null)
            {
                throw new ArgumentNullException(nameof(converter));
            }

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

            _converter = converter;

            _inputProperty = ReadPropertyCache <TInput> .GetProperty <Task <TInputProperty> >(propertyName);
        }
Ejemplo n.º 15
0
        public bool TryGetCorrelationId(T message, out Guid?correlationId)
        {
            var propertyInfo = typeof(T).GetProperty(_propertyName);

            if (propertyInfo != null && propertyInfo.PropertyType == typeof(Guid))
            {
                var property = ReadPropertyCache <T> .GetProperty <Guid>(propertyInfo);

                correlationId = property.Get(message);
                return(true);
            }

            if (propertyInfo != null && propertyInfo.PropertyType == typeof(Guid?))
            {
                var property = ReadPropertyCache <T> .GetProperty <Guid?>(propertyInfo);

                correlationId = property.Get(message);
                return(true);
            }

            correlationId = null;
            return(false);
        }
Ejemplo n.º 16
0
 public MessageLifetimeScopeIdAccessor(PropertyInfo propertyInfo)
 {
     _property = ReadPropertyCache <TMessage> .GetProperty <TId>(propertyInfo);
 }
Ejemplo n.º 17
0
 static Func <TSaga, TProperty> GetGetMethod(PropertyInfo property)
 {
     return(ReadPropertyCache <TSaga> .GetProperty <TProperty>(property).Get);
 }
 public LoadMessageDataPropertyProvider(IMessageDataRepository repository, PropertyInfo property)
 {
     _repository = repository;
     _property   = ReadPropertyCache <TInput> .GetProperty <MessageData <TValue> >(property);
 }
Ejemplo n.º 19
0
 public PropertySetCorrelationId(PropertyInfo propertyInfo)
 {
     _property = ReadPropertyCache <T> .GetProperty <Guid>(propertyInfo);
 }
 public NullablePropertyMessageCorrelationId(PropertyInfo propertyInfo)
 {
     _property = ReadPropertyCache <T> .GetProperty <Guid?>(propertyInfo);
 }
Ejemplo n.º 21
0
 public CorrelatedBySetCorrelationId()
 {
     _property = ReadPropertyCache <CorrelatedBy <Guid> > .GetProperty <Guid>(nameof(CorrelatedBy <Guid> .CorrelationId));
 }