public string GetCorrelationId <TMessage>(TMessage message) { var type = typeof(TMessage); var id = ""; if (CorrelationMethods.ContainsKey(type)) { id = CorrelationMethods[type](message); } return(id); }
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); }
public IConfigureChannel CorrelateBy <TMessage>(string correlationId) { CorrelationMethods.AddOrUpdate(typeof(TMessage), x => o => correlationId, (k, v) => o => correlationId); return(this); }