This topic has not yet been rated - Rate this topic

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)
[AttributeUsageAttribute(AttributeTargets.Property|AttributeTargets.Parameter, AllowMultiple = false, 
	Inherited = true)]
public sealed class DependencyAttribute : DependencyResolutionAttribute
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.
Did you find this helpful?
(1500 characters remaining)