Class ServiceLocator
- Namespace
- Dynamicweb.Extensibility.Providers
- Assembly
- Dynamicweb.Core.dll
This class is a helper that provides a default implementation
for most of the methods of IService
- Inheritance
-
Service
Locator
- Implements
- Derived
- Inherited Members
Methods
DoGetAllInstances(Type)
When implemented by inheriting classes, this method will do the actual work of resolving all the requested service instances.
Parameters
serviceType
TypeType of service requested.
Returns
- IEnumerable<object>
Sequence of service instance objects.
DoGetInstance(Type)
When implemented by inheriting classes, this method will do the actual work of resolving the requested service instance.
Parameters
serviceType
TypeType of instance requested.
Returns
- object
The requested service instance.
FormatActivationExceptionMessage(Exception, Type)
Format the exception message for use in an Activation
protected virtual string FormatActivationExceptionMessage(Exception actualException, Type serviceType)
Parameters
actualException
ExceptionThe actual exception thrown by the implementation.
serviceType
TypeType of service requested.
Returns
- string
The formatted exception message string.
GetAllInstances(Type)
Get all instances of the given serviceType
currently
registered in the container.
Parameters
serviceType
TypeType of object requested.
Returns
- IEnumerable<object>
A sequence of instances of the requested
serviceType
.
Exceptions
- Activation
Exception if there is are errors resolving the service instance.
GetAllInstances<TService>()
Get all instances of the given TService
currently
registered in the container.
Returns
- IEnumerable<TService>
A sequence of instances of the requested
TService
.
Type Parameters
TService
Type of object requested.
Exceptions
- Activation
Exception if there is are errors resolving the service instance.
GetInstance(Type)
Get an instance of the given serviceType
.
Parameters
serviceType
TypeType of object requested.
Returns
- object
The requested service instance.
Exceptions
- Activation
Exception if there is an error resolving the service instance.
GetInstance<TService>()
Get an instance of the given TService
.
Returns
- TService
The requested service instance.
Type Parameters
TService
Type of object requested.
Exceptions
- Activation
Exception if there is are errors resolving the service instance.
GetService(Type)
Implementation of Get
Parameters
serviceType
TypeThe requested service.
Returns
- object
The requested object.
Exceptions
- Activation
Exception if there is an error in resolving the service instance.