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
namestringService name.
operationsIEnumerable<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
NamestringService name.
OperationsIReadOnlyDictionary<string, OperationDefinition>Collection of operation definitions, keyed by operation name.
Properties
Name
Service name.
public string Name { get; init; }
Property Value
Operations
Collection of operation definitions, keyed by operation name.
public IReadOnlyDictionary<string, OperationDefinition> Operations { get; init; }
Property Value
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
typeTypeInterface 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
TInterface type.