예제 #1
0
 /// <summary>
 /// Map the message type to the specified address
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="destinationAddress"></param>
 public static void Map <T>(Uri destinationAddress)
     where T : class
 {
     EndpointConventionCache <T> .Map((out Uri address) =>
     {
         address = destinationAddress;
         return(true);
     });
 }
예제 #2
0
        public static bool TryGetDestinationAddress(object message, out Uri destinationAddress)
        {
            if (message == null)
            {
                throw new ArgumentNullException(nameof(message));
            }

            return(EndpointConventionCache.TryGetEndpointAddress(message, out destinationAddress));
        }
예제 #3
0
            bool IEndpointConventionCache <TMessage> .TryGetEndpointAddress(out Uri address)
            {
                if (typeof(TAdapter).IsAssignableFrom(typeof(TMessage)))
                {
                    return(EndpointConventionCache <TAdapter> .TryGetEndpointAddress(out address));
                }

                address = default;
                return(false);
            }
예제 #4
0
            bool IEndpointConventionCache <TMessage> .TryGetEndpointAddress(TMessage message, out Uri address)
            {
                var messageOfT = message as TAdapter;

                if (messageOfT != null)
                {
                    return(EndpointConventionCache <TAdapter> .TryGetEndpointAddress(messageOfT, out address));
                }

                address = default(Uri);
                return(false);
            }
예제 #5
0
 public static bool TryGetDestinationAddress(Type messageType, out Uri destinationAddress)
 {
     return(EndpointConventionCache.TryGetEndpointAddress(messageType, out destinationAddress));
 }
예제 #6
0
 public static bool TryGetDestinationAddress <T>(out Uri destinationAddress)
     where T : class
 {
     return(EndpointConventionCache <T> .TryGetEndpointAddress(out destinationAddress));
 }
예제 #7
0
 /// <summary>
 /// Map the message type to the endpoint returned by the specified method
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="endpointAddressProvider"></param>
 public static void Map <T>(EndpointAddressProvider <T> endpointAddressProvider)
     where T : class
 {
     EndpointConventionCache <T> .Map(endpointAddressProvider);
 }
예제 #8
0
 /// <summary>
 /// Map the message type to the specified address
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="destinationAddress"></param>
 public static void Map <T>(Uri destinationAddress)
     where T : class
 {
     EndpointConventionCache <T> .Map(destinationAddress);
 }