Host.AddService Method

Definition

Overloads

AddService(Type, Object)

Adds a service to this Host

AddService<T>(T)

Adds a service to this Host

AddService(Type, Object)

Adds a service to this Host

public void AddService (Type serviceType, object serviceObject);

Parameters

serviceType
Type

The Type of a service

serviceObject
Object

The actual service Object itself

Exceptions

Thrown if the service has already been added

Thrown if serviceType is not an interface

Applies to

AddService<T>(T)

Adds a service to this Host

[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Use AddService(Type serviceType, object serviceObject) instead.")]
public void AddService<T> (T service) where T : class;

Type Parameters

T

The service type

Parameters

service
T

The service Object to add

Attributes

Exceptions

Thrown if the service has already been added

Thrown if T is not an interface

Applies to