Class ServiceHandlerInstance
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
definitionServiceDefinitionDefinition for this service.
operationHandlersIReadOnlyDictionary<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
OperationHandlers
Gets the operation handlers, keyed by operation name.
public IReadOnlyDictionary<string, IOperationHandler<object?, object?>> OperationHandlers { get; }
Property Value
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
instanceobjectInstance of service handler class.
Returns
- ServiceHandlerInstance
Service handler instance.