Table of Contents

AddHandler Method

Definition

Namespace
Savvyio
Assemblies
Savvyio.Core.dll
Source
src/Savvyio.Core/SavvyioOptions.cs

AddHandler<THandler, TRequest, TImplementation>()

Adds a handler of type THandler to HandlerServiceTypes (if not already registered) and HandlerImplementationTypes (if not already registered).

public SavvyioOptions AddHandler<THandler, TRequest, TImplementation>() where THandler : IHandler<TRequest> where TRequest : IRequest where TImplementation : class, THandler

Returns

SavvyioOptions

A reference to this instance so that additional configuration calls can be chained.

Type Parameters

THandler

The type of the service to add.

TRequest

The type of the model to handle.

TImplementation

The type of the implementation to use.

Remarks

Type is only added if the following conditions are true: typeof(THandler).HasInterfaces(typeof(IHandler<TRequest>)) && typeof(T).IsClass && !typeof(T).IsAbstract && !typeof(T).IsInterface

AddHandler(Type, Type)

Adds a dispatcher of type IHandler to HandlerServiceTypes (if not already registered) and HandlerImplementationTypes (if not already registered).

public SavvyioOptions AddHandler(Type service, Type implementation)

Parameters

service Type

The Type of the IHandler interface to add.

implementation Type

The type of the implementation to use.

Returns

SavvyioOptions

A reference to this instance so that additional configuration calls can be chained.