public static PortType PortType(this IBaseMessage message) { if (message.IsSolicitResponse()) { return(Message.PortType.SolicitResponseSendPort); } if (message.IsRequestResponse()) { return(Message.PortType.RequestResponseReceivePort); } if (message.Direction().IsInbound()) { return(Message.PortType.OneWayReceivePort); } if (message.Direction().IsOutbound()) { return(Message.PortType.OneWaySendPort); } throw new Exception("Unable to determine port type."); }