Class ServiceConfigurationAttribute
Marks a type that is automatically registered as a service by the EPiServer initialization system.
Inheritance
Inherited Members
Namespace: EPiServer.ServiceLocation
Assembly: EPiServer.Framework.dll
Version: 9.12.2Syntax
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = false)]
public sealed class ServiceConfigurationAttribute : Attribute, _Attribute, IServiceConfiguration
Constructors
ServiceConfigurationAttribute()
Service instance using the attributed type as service type.
Declaration
public ServiceConfigurationAttribute()
ServiceConfigurationAttribute(Type)
Service instance using the given parameter as service type.
Declaration
public ServiceConfigurationAttribute(Type serviceType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | serviceType |
Properties
FactoryMember
Gets or sets the name of a static property or method on the attributed class from which the service instance is retrieved.
Declaration
public string FactoryMember { get; set; }
Property Value
Type | Description |
---|---|
System.String |
FactoryType
Gets the name of a type that is responsible for creating instances of the attributed service.
Declaration
public Type FactoryType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |
IncludeServiceAccessor
Indicates if a ServiceAccessor<TService> should be registered for the type as well.
Declaration
public bool IncludeServiceAccessor { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Default value is true
Lifecycle
Gets or sets the scope of instances of the attributed class, i.e. when to reuse instances of the same service.
Declaration
public ServiceInstanceScope Lifecycle { get; set; }
Property Value
Type | Description |
---|---|
ServiceInstanceScope |
ServiceType
Gets or sets the type of service the attributed class represents.
Declaration
public Type ServiceType { get; set; }
Property Value
Type | Description |
---|---|
System.Type |