Interception.AddPolicy Method

Retired Content

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The latest Unity Application Block information can be found at the Unity Application Block site.

Starts the definition of a new RuleDrivenPolicy.

Namespace:  Microsoft.Practices.Unity.InterceptionExtension
Assembly:  Microsoft.Practices.Unity.Interception (in Microsoft.Practices.Unity.Interception.dll)

Syntax

'Declaration
Public Function AddPolicy ( _
    policyName As String _
) As PolicyDefinition
public PolicyDefinition AddPolicy(
    string policyName
)
public:
PolicyDefinition^ AddPolicy(
    String^ policyName
)
public function AddPolicy(
    policyName : String
) : PolicyDefinition

Parameters

Return Value

Remarks

This is a convenient way for defining a new policy and the IMatchingRule instances and ICallHandler instances that are required by a policy.

This mechanism is just a shortcut for what can be natively expressed by wiring up together objects with repeated calls to the ConfigureInjectionFor(Type, String, array<InjectionMember[]) method.

See Also

Interception Class

Microsoft.Practices.Unity.InterceptionExtension Namespace