MetalamaAPI documentationExtensions APIMetalama.​Extensions.​Dependency­InjectionDependency­Injection­ExtensionsTry­Introduce­Dependency
Open sandboxFocus

DependencyInjectionExtensions.TryIntroduceDependency Method

TryIntroduceDependency(IAspectBuilder, DependencyProperties, out IFieldOrProperty)

Tries to introduce a dependency into a specified type.

public static bool TryIntroduceDependency(this IAspectBuilder aspectBuilder, DependencyProperties properties, out IFieldOrProperty dependencyFieldOrProperty)
Type Name Description
IAspectBuilder aspectBuilder

An IAspectBuilder.

DependencyProperties properties

The properties of the dependency to introduce.

IFieldOrProperty dependencyFieldOrProperty

When the method succeeds, the field or dependency that represents the dependency.

Type Description

true in case of success, otherwise false. When the field or property already exists, this method returns true and has no effect.