Table of Contents

Class ServiceHandlerInstance

Namespace
NexusRpc.Handlers
Assembly
NexusRpc.dll

Representation of a service handler instance with instantiated operation handlers. Users should use FromInstance(object) to get an instance.

public class ServiceHandlerInstance
Inheritance
ServiceHandlerInstance
Inherited Members

Constructors

ServiceHandlerInstance(ServiceDefinition, IReadOnlyDictionary<string, IOperationHandler<object?, object?>>)

Initializes a new instance of the ServiceHandlerInstance class.

public ServiceHandlerInstance(ServiceDefinition definition, IReadOnlyDictionary<string, IOperationHandler<object?, object?>> operationHandlers)

Parameters

definition ServiceDefinition

Definition for this service.

operationHandlers IReadOnlyDictionary<string, IOperationHandler<object, object>>

All instantiated operation handlers, keyed by operation name.

Remarks

This is not commonly used, users should prefer FromInstance(object) with an instantiated instance of a class with a NexusServiceHandlerAttribute attribute. This constructor does minimal validation on operation handlers.

Properties

Definition

Gets the service definition.

public ServiceDefinition Definition { get; }

Property Value

ServiceDefinition

OperationHandlers

Gets the operation handlers, keyed by operation name.

public IReadOnlyDictionary<string, IOperationHandler<object?, object?>> OperationHandlers { get; }

Property Value

IReadOnlyDictionary<string, IOperationHandler<object, object>>

Methods

FromInstance(object)

Create a service handler instance from an instance of a class with a NexusServiceHandlerAttribute attribute. This is the primary way to create a service instance.

public static ServiceHandlerInstance FromInstance(object instance)

Parameters

instance object

Instance of service handler class.

Returns

ServiceHandlerInstance

Service handler instance.