Metalama 1.0 / / Metalama Documentation / Aspect API Documentation / Metalama.​Framework.​Dependency­Injection / Introduce­Dependency­Attribute

Class IntroduceDependencyAttribute

Custom attribute that, when be applied to a field or automatic property of an aspect, means that this field or property is a service dependency that introduced into the target type and handled by a dependency injection framework. Contrarily to DependencyAttribute that can be used in user code, this attribute can be used only in an aspect.

Inheritance
IntroduceDependencyAttribute
Namespace: Metalama.Framework.DependencyInjection
Assembly: Metalama.Framework.DependencyInjection.dll
Syntax
public class IntroduceDependencyAttribute : DeclarativeAdviceAttribute, IAdviceAttribute, IDependencyAttribute
Remarks

The implementation of this custom attribute depends on the selected dependency injection framework.

Constructors

Name Description
IntroduceDependencyAttribute()

Properties

Name Description
IsLazy

Gets or sets a value indicating whether the dependency should be pulled from the container lazily, i.e. upon first use.

IsRequired

Gets or sets a value indicating whether the dependency is required.

Methods

Name Description
BuildAdvice(IMemberOrNamedType, String, IAspectBuilder<IDeclaration>)
GetIsLazy()

Gets the value of the IsLazy if it has been assigned, or null if it has not been assigned.

GetIsRequired()

Gets the value of the IsRequired if it has been assigned, or null if it has not been assigned.

Extension Methods

PresentingExtensions.AsHyperlink(Object)