Skip to main content

Interface IHandler

The IHandler interface declares methods for building the chain of handlers. It also declares a method for executing a request.

public interface IHandler

Methods​

Handle(object)​

Handles the given request. This method will be implemented by concrete handlers to process the request.

object Handle(object request)

Parameters​

NameTypeDescription
requestobjectThe request object to be processed.

Returns​

object — The response after handling the request.

SetNext(IHandler)​

Sets the next handler in the chain.

IHandler SetNext(IHandler handler)

Parameters​

NameTypeDescription
handlerIHandlerThe next handler to be set in the chain.

Returns​

IHandler — The current handler with the next handler set.

  • Methods
    • Handle(object)
    • SetNext(IHandler)