Share via


FabricRuntime.RegisterServiceType(String, Type) Method

Definition

Associates the specified serviceTypeName with the actual managed Type that implements it.

public void RegisterServiceType (string serviceTypeName, Type serviceTypeImplementation);
member this.RegisterServiceType : string * Type -> unit
Public Sub RegisterServiceType (serviceTypeName As String, serviceTypeImplementation As Type)

Parameters

serviceTypeName
String

The type name of the service type (as a string). This should match the type of the service group type as specified in the manifests and/or the CreateService command.

serviceTypeImplementation
Type

The qualified service Type that implements the specified serviceTypeName.

Remarks

Note that this mechanism for service type registration does not require a custom IStatelessServiceFactory or IStatefulServiceFactory to be provided at registration time. Service Fabric will generate one at runtime and utilize it automatically. If there is a need for a custom implementation of the factory, you can implement IStatelessServiceFactory or IStatefulServiceFactory and then provide those via the corresponding factory registration methods (RegisterStatelessServiceFactoryAsync(String, IStatelessServiceFactory, TimeSpan, CancellationToken) or RegisterStatefulServiceFactoryAsync(String, IStatefulServiceFactory, TimeSpan, CancellationToken))

Applies to