public static void Publish(this IEdiMessage obj) { var publisher = obj.Publisher(); if (publisher == null) { throw new InvalidOperationException(string.Format("No publisher found for message type {0}", obj.GetType().Name)); } publisher.PublishMessage(obj); }