Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Interface IServiceConfigurationProvider

Use to configure implementations for the services that are used by the application.

Namespace: EPiServer.ServiceLocation
Assembly: EPiServer.Framework.dll
Version: 11.20.7
Syntax
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.Type serviceType

The service type to register an implemenation for

System.Func<IServiceLocator, System.Object> implementationFactory

The factory method used to create service instances

ServiceInstanceScope lifetime

Specifies which lifecycle the implementation should have

Returns
Type Description
IRegisteredService

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.Type serviceType

The service type to register an implemenation for

System.Object instance

The singleton instance of the service tyep

Returns
Type Description
IRegisteredService

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.Type serviceType

The service type to register an implemenation for

System.Type implementationType

The implementation type for the service

ServiceInstanceScope lifetime

Specifies which lifecycle the implementation should have

Returns
Type Description
IRegisteredService

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.Type serviceType

The service type to check for implemenation existance

Returns
Type Description
System.Boolean

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.Type serviceType

The service type to register an implemenation for

Returns
Type Description
IServiceConfigurationProvider

The used service configuration provider

Extension Methods