CQRS.NET  4.0
A lightweight enterprise Function as a Service (FaaS) framework to write function based serverless and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.

◆ GetSingleHandler< TMessage >() [1/2]

RouteHandlerDelegate Cqrs.Bus.RouteManager.GetSingleHandler< TMessage > ( bool  throwExceptionOnNoRouteHandlers = true)

Gets the single RouteHandlerDelegate expected for handling TMessage .

Template Parameters
TMessageThe Type of IMessage to find a RouteHandlerDelegate for.
Parameters
throwExceptionOnNoRouteHandlersIf true will throw an Exception if no RouteHandlerDelegate found.
Exceptions
MultipleCommandHandlersRegisteredExceptionIf more than one RouteHandlerDelegate is found and TMessage is an ICommand<TAuthenticationToken>.
NoCommandHandlerRegisteredExceptionIf no RouteHandlerDelegate is found and TMessage is an ICommand<TAuthenticationToken> and throwExceptionOnNoRouteHandlers is true.
InvalidOperationExceptionIf more than one RouteHandlerDelegate is found and TMessage is not an ICommand<TAuthenticationToken> OR If no RouteHandlerDelegate is found and TMessage is not an ICommand<TAuthenticationToken> and throwExceptionOnNoRouteHandlers is true.
Type Constraints
TMessage :IMessage