Queue GetDestinationForSend(object message) { IReadOnlyCollection <Address> destinations = router.GetDestinationFor(message.GetType()); if (destinations.Count > 1) { throw new InvalidOperationException("Sends can only have one target address."); } return(destinations.OfType <Queue>().Single()); }