예제 #1
0
        public string GetCorrelationId <TMessage>(TMessage message)
        {
            var type = typeof(TMessage);
            var id   = "";

            if (CorrelationMethods.ContainsKey(type))
            {
                id = CorrelationMethods[type](message);
            }
            return(id);
        }
예제 #2
0
 public IConfigureChannel CorrelateBy <TMessage>(Func <TMessage, string> messageProperty)
 {
     CorrelationMethods.AddOrUpdate(typeof(TMessage), x => o => messageProperty((TMessage)o), (k, v) => o => messageProperty((TMessage)o));
     return(this);
 }
예제 #3
0
 public IConfigureChannel CorrelateBy <TMessage>(string correlationId)
 {
     CorrelationMethods.AddOrUpdate(typeof(TMessage), x => o => correlationId, (k, v) => o => correlationId);
     return(this);
 }