Table of Contents

Class ServiceDefinition

Namespace
NexusRpc
Assembly
NexusRpc.dll

Definition of a Nexus service. Most users do not instantiate this directly, it is implicitly instantiated by the system. For those that do, FromType(Type) is the common way to obtain a definition from an interface.

public record ServiceDefinition : IEquatable<ServiceDefinition>
Inheritance
ServiceDefinition
Implements
Inherited Members

Constructors

ServiceDefinition(string, IEnumerable<OperationDefinition>)

Initializes a new instance of the ServiceDefinition class. This is a helper to convert a collection of operations into a dictionary.

public ServiceDefinition(string name, IEnumerable<OperationDefinition> operations)

Parameters

name string

Service name.

operations IEnumerable<OperationDefinition>

Collection of operation definitions.

ServiceDefinition(string, IReadOnlyDictionary<string, OperationDefinition>)

Definition of a Nexus service. Most users do not instantiate this directly, it is implicitly instantiated by the system. For those that do, FromType(Type) is the common way to obtain a definition from an interface.

public ServiceDefinition(string Name, IReadOnlyDictionary<string, OperationDefinition> Operations)

Parameters

Name string

Service name.

Operations IReadOnlyDictionary<string, OperationDefinition>

Collection of operation definitions, keyed by operation name.

Properties

Name

Service name.

public string Name { get; init; }

Property Value

string

Operations

Collection of operation definitions, keyed by operation name.

public IReadOnlyDictionary<string, OperationDefinition> Operations { get; init; }

Property Value

IReadOnlyDictionary<string, OperationDefinition>

Methods

FromType(Type)

Create a service definition from an interface type. This is memoized by type to make successive calls quick.

public static ServiceDefinition FromType(Type type)

Parameters

type Type

Interface type.

Returns

ServiceDefinition

Service definition for the type.

FromType<T>()

Create a service definition from an interface type. This is memoized by type to make successive calls quick.

public static ServiceDefinition FromType<T>()

Returns

ServiceDefinition

Service definition for the type.

Type Parameters

T

Interface type.