NServiceBus.RoutingOptionExtensions.IsRoutingToThisEndpoint C# (CSharp) Method

IsRoutingToThisEndpoint() public static method

Returns whether the message should be routed to this endpoint.
public static IsRoutingToThisEndpoint ( this options ) : bool
options this Option being extended.
return bool
        public static bool IsRoutingToThisEndpoint(this SendOptions options)
        {
            Guard.AgainstNull(nameof(options), options);

            UnicastSendRouterConnector.State state;
            if (options.Context.TryGet(out state))
            {
                return state.Option == UnicastSendRouterConnector.RouteOption.RouteToAnyInstanceOfThisEndpoint;
            }

            return false;
        }