TagAttributeMatchingRule with constructors

Topics: Policy Injection Application Block
Mar 4, 2015 at 11:19 AM
Hello,

I am have the below container policy defined in web.config. In Entlib5 it used to accept two constructor parameters; tagToMatch and ignoreCase. Entlib6 however does not accept these parameters. How do i pass the matching rule name 'myTag' to the class? Aren't they needed anymore?

There is another class in 'Microsoft.Practices.Unity.InterceptionExtension, Microsoft.Practices.Unity.Interception.dll', with two constructors to accept tagToMatch and ignoreCase, but does not have the ConfigurationElementType attribute.

Please assist.

private void Register(PolicyData policyInfo)
{
InjectionMember[] injectionMembers;

foreach (MatchingRuleData matchingRuleData in policyInfo.MatchingRules)
{
    injectionMembers = GetInjectionMembers(matchingRuleData);
    container.Configure<Interception>()
        .AddPolicy(policyInfo.Name)
        .AddMatchingRule(matchingRuleData.Type, injectionMembers);
}
}


<MyContainerPolicies>
<policies>
<add name="myTagPolicy">
 <matchingRules>
  <add match="myTag" ignoreCase="true" type="Microsoft.Practices.EnterpriseLibrary.PolicyInjection.MatchingRules.TagAttributeMatchingRule, Microsoft.Practices.EnterpriseLibrary.PolicyInjection, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="Tag Attribute Matching Rule" />
</matchingRules>
<handlers>
  <add name="ValidationCallHandler" SpecificationSource="Configuration" Order="2" type="" />
</handlers>
</add>
</policies>
</MyContainerPolicies>


Thanks
Rohit