Table of Contents

Interface IServiceLocator

Namespace
Dynamicweb.Extensibility
Assembly
Dynamicweb.Core.dll

The generic Service Locator interface. This interface is used to retrieve services (instances identified by type and optional name) from a container.

public interface IServiceLocator : IServiceProvider
Inherited Members

Methods

GetAllInstances(Type)

Get all instances of the given serviceType currently registered in the container.

IEnumerable<object> GetAllInstances(Type serviceType)

Parameters

serviceType Type

Type of object requested.

Returns

IEnumerable<object>

A sequence of instances of the requested serviceType.

Exceptions

ActivationException

if there is are errors resolving the service instance.

GetAllInstances<TService>()

Get all instances of the given TService currently registered in the container.

IEnumerable<TService> GetAllInstances<TService>()

Returns

IEnumerable<TService>

A sequence of instances of the requested TService.

Type Parameters

TService

Type of object requested.

Exceptions

ActivationException

if there is are errors resolving the service instance.

GetInstance(Type)

Get an instance of the given serviceType.

object GetInstance(Type serviceType)

Parameters

serviceType Type

Type of object requested.

Returns

object

The requested service instance.

Exceptions

ActivationException

if there is an error resolving the service instance.

GetInstance<TService>()

Get an instance of the given TService.

TService GetInstance<TService>()

Returns

TService

The requested service instance.

Type Parameters

TService

Type of object requested.

Exceptions

ActivationException

if there is are errors resolving the service instance.

To top