Interface IRequestDispatcher
Represents a dispatcher of generic IRequest<TRequest, TResult> instances.
public interface IRequestDispatcher
- Extension Methods
Methods
TryDispatch<TRequest, TResult>(IRequest<TRequest, TResult>, out TResult)
Attempts to dispatch the provided IRequest<TRequest, TResult> instance.
bool TryDispatch<TRequest, TResult>(IRequest<TRequest, TResult> request, out TResult result) where TRequest : class, IRequest<TRequest, TResult>
Parameters
request
IRequest<TRequest, TResult>Request to handle.
result
TResultout parameter that returns a result of the provided
request
if it was handled.
Returns
- bool
true when the provided
request
was handled, otherwise false.
Type Parameters
TRequest
Request type.
TResult
Request's result type.
Exceptions
- InvalidRequestTypeException
When the provided
request
is not ofTRequest
type.
TryDispatch<TRequest, TResult>(TRequest, out TResult)
Attempts to dispatch the provided IRequest<TRequest, TResult> instance.
bool TryDispatch<TRequest, TResult>(TRequest request, out TResult result) where TRequest : struct, IRequest<TRequest, TResult>
Parameters
request
TRequestRequest to handle.
result
TResultout parameter that returns a result of the provided
request
if it was handled.
Returns
- bool
true when the provided
request
was handled, otherwise false.
Type Parameters
TRequest
Request type.
TResult
Request's result type.