Table of Contents

Class RegisterImplementationAttribute

Namespace
CMS
Assembly
CMS.Core.dll

Marks class as implementation of ImplementedType. The application collects implementations during its initialization in order to register them within inversion of control container.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true, Inherited = false)]
public sealed class RegisterImplementationAttribute : Attribute
Inheritance
object
Attribute
RegisterImplementationAttribute
Extension Methods

Remarks

Since version 11 the attribute no longer registers implementation within ObjectFactory<T>. To register an implementation within object factory, use SetObjectTypeTo<NewType>(bool, bool).

Constructors

RegisterImplementationAttribute(Type, Type)

Instructs ObjectFactory<T> to use implementation whenever an instance of implementedType is requested.

public RegisterImplementationAttribute(Type implementedType, Type implementation)

Parameters

implementedType Type

Interface to associate implementation with.

implementation Type

Implementation of implementedType.

Properties

Implementation

Implementation of ImplementedType to be used by ObjectFactory<T>.

public Type Implementation { get; }

Property Value

Type

ImplementedType

Type for which an implementation is being registered.

public Type ImplementedType { get; }

Property Value

Type

Lifestyle

Lifestyle of service's implementation registered by this attribute. Singleton by default.

public Lifestyle Lifestyle { get; set; }

Property Value

Lifestyle

Name

Sets an explicit name of the registration. If not set, the name is automatically inferred from the implementation being registered.

public string Name { get; set; }

Property Value

string

Priority

Priority of service's registration. Default by default.

public RegistrationPriority Priority { get; set; }

Property Value

RegistrationPriority

Remarks

The order of registrations is determined by the order in which modules (assemblies) are initialized. The order respects assemblies' references. There is no guarantee on order within an assembly.

See Also