Esempio n. 1
0
        public SetCorrelationIdMessageSendTopology(ISetCorrelationId <T> setCorrelationId)
        {
            if (setCorrelationId == null)
            {
                throw new ArgumentNullException(nameof(setCorrelationId));
            }

            _filter = new SetCorrelationIdFilter <T>(setCorrelationId);
        }
        public bool TryGetSetCorrelationId(out ISetCorrelationId <T> setCorrelationId)
        {
            var correlatedByInterface = typeof(T).GetInterface <CorrelatedBy <Guid> >();

            if (correlatedByInterface != null)
            {
                var objectType = typeof(CorrelatedBySetCorrelationId <>).MakeGenericType(typeof(T));
                setCorrelationId = (ISetCorrelationId <T>)Activator.CreateInstance(objectType);
                return(true);
            }

            setCorrelationId = null;
            return(false);
        }
        public bool TryGetSetCorrelationId(out ISetCorrelationId <T> setCorrelationId)
        {
            var propertyInfo = typeof(T).GetProperty(_propertyName);

            if (propertyInfo != null && propertyInfo.PropertyType == typeof(Guid))
            {
                setCorrelationId = new PropertySetCorrelationId <T>(propertyInfo);
                return(true);
            }

            if (propertyInfo != null && propertyInfo.PropertyType == typeof(Guid?))
            {
                setCorrelationId = new NullablePropertySetCorrelationId <T>(propertyInfo);
                return(true);
            }
            setCorrelationId = null;
            return(false);
        }
Esempio n. 4
0
 MessageCorrelationCache(ISetCorrelationId <T> setCorrelationId)
 {
     _setCorrelationIdPipe = new Lazy <ISetCorrelationId <T> >(() => setCorrelationId);
 }
Esempio n. 5
0
 public SetCorrelationIdFilter(ISetCorrelationId <T> setCorrelationId)
 {
     _setCorrelationId = setCorrelationId;
 }
Esempio n. 6
0
 public bool TryGetSetCorrelationId(out ISetCorrelationId <T> setCorrelationId)
 {
     setCorrelationId = _setCorrelationId;
     return(true);
 }
Esempio n. 7
0
 public SetCorrelationIdSelector(ISetCorrelationId <T> setCorrelationId)
 {
     _setCorrelationId = setCorrelationId;
 }
 public void SetCorrelationId(ISetCorrelationId <TMessage> setCorrelationId)
 {
     _selectors.Insert(0, new SetCorrelationIdSelector <TMessage>(setCorrelationId));
 }