DependencyAttribute Class (Microsoft.Practices.Unity)

Switch View :
ScriptFree
Unity Application Block 2.0 - April 2010
DependencyAttribute Class

This attribute is used to mark properties and parameters as targets for injection.

Namespace:  Microsoft.Practices.Unity
Assembly:  Microsoft.Practices.Unity (in Microsoft.Practices.Unity.dll)
Syntax

Visual Basic (Declaration)
<AttributeUsageAttribute(AttributeTargets.Property Or AttributeTargets.Parameter, AllowMultiple := False,  _
	Inherited := True)> _
Public NotInheritable Class DependencyAttribute _
	Inherits DependencyResolutionAttribute
C#
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Parameter, AllowMultiple = false, 
	Inherited = true)]
public sealed class DependencyAttribute : DependencyResolutionAttribute
Visual C++
[AttributeUsageAttribute(AttributeTargets::Property|AttributeTargets::Parameter, AllowMultiple = false, 
	Inherited = true)]
public ref class DependencyAttribute sealed : public DependencyResolutionAttribute
JScript
public final class DependencyAttribute extends DependencyResolutionAttribute
Remarks

For properties, this attribute is necessary for injection to happen. For parameters, it's not needed unless you want to specify additional information to control how the parameter is resolved.
Inheritance Hierarchy

System..::.Object
  System..::.Attribute
    Microsoft.Practices.Unity..::.DependencyResolutionAttribute
      Microsoft.Practices.Unity..::.DependencyAttribute
See Also