Interface IServiceConfigurationProvider
Use to configure implementations for the services that are used by the application.
Namespace: EPiServer.ServiceLocation
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
public interface IServiceConfigurationProvider
Methods
Add(Type, Func<IServiceLocator, Object>, ServiceInstanceScope)
Registers an implementation factory for a service type.
Declaration
IRegisteredService Add(Type serviceType, Func<IServiceLocator, object> implementationFactory, ServiceInstanceScope lifetime)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceType | The service type to register an implemenation for |
System. |
implementationFactory | The factory method used to create service instances |
Service |
lifetime | Specifies which lifecycle the implementation should have |
Returns
Type | Description |
---|---|
IRegistered |
The used service configuration provider |
Add(Type, Object)
Registers an implementation instance for a service type.
Declaration
IRegisteredService Add(Type serviceType, object instance)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceType | The service type to register an implemenation for |
System. |
instance | The singleton instance of the service tyep |
Returns
Type | Description |
---|---|
IRegistered |
The used service configuration provider |
Add(Type, Type, ServiceInstanceScope)
Registers an implementation type for a service type.
Declaration
IRegisteredService Add(Type serviceType, Type implementationType, ServiceInstanceScope lifetime)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceType | The service type to register an implemenation for |
System. |
implementationType | The implementation type for the service |
Service |
lifetime | Specifies which lifecycle the implementation should have |
Returns
Type | Description |
---|---|
IRegistered |
The used service configuration provider |
Contains(Type)
Checks if a service type has any implementations registered.
Declaration
bool Contains(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceType | The service type to check for implemenation existance |
Returns
Type | Description |
---|---|
System. |
The used service configuration provider |
RemoveAll(Type)
Removes all previously registered entries for the service.
Declaration
IServiceConfigurationProvider RemoveAll(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
System. |
serviceType | The service type to register an implemenation for |
Returns
Type | Description |
---|---|
IService |
The used service configuration provider |