IEnumerable <KeyValuePair <string, string> > GetReceiverValues(ReceiverTraceDetail detail) { if (detail.MessageType.IsNotEmpty()) { yield return(new KeyValuePair <string, string>("Message Type", detail.MessageType)); } if (detail.CorrelationId.IsNotEmpty()) { yield return(new KeyValuePair <string, string>("Correlation Id", detail.CorrelationId)); } if (detail.Duration != TimeSpan.Zero) { yield return (new KeyValuePair <string, string>("Duration (ms)", ((int)detail.Duration.TotalMilliseconds).ToString("N0"))); } }
IDictionary <string, string> GetReceiverDictionary(ReceiverTraceDetail detail) { return(GetReceiverValues(detail).ToDictionary(x => x.Key, x => x.Value)); }