Share via


The Property Matching Rule

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 Enterprise Library information can be found at the Enterprise Library site.

The Property Matching Rule allows developers, operators, and administrators to select individual properties of the target classes based on their name, including using wildcard characters, and the combination of accessors they include.

Note

The Policy Injection Application Block includes matching rule configuration placeholders that provide backward compatibility. The implementation of matching rules is described in the Unity Application Block documentation. For more information, see The Property Matching Rule in the Unity Application Block documentation.

Configuration Settings of the Property Matching Rule

The configuration settings available for the Property Matching Rule are a collection of property matches, each consisting of three properties:

  • Match (String). This is the name of the target property. It can include or consist of the * or ? wildcard characters to select multiple properties. You can also use square brackets [ ] to specify a range of characters. The following are examples:
    • Get*
    • *Orders
    • *TransactedOrder???
    • BusinessRules[order]Process.*
    • *
  • MatchOption (PropertyMatchingOption). This is a value from the PropertyMatchingOption enumeration that indicates if the rule should match on the Get, Set, or both the accessors for a selected property. Valid values are Get, Set, and GetOrSet.
  • IgnoreCase (Boolean). This specifies whether the match should be carried out on a case-sensitive basis.

The next procedure describes how to configure the Property Matching Rule using the Configuration Console or the Visual Studio Configuration Editor.

To configure the Property Matching Rule

  1. Right-click the Matching Rules node in the Enterprise Library Configuration Console or Visual Studio Configuration Editor, point to New, and then click Property Matching Rule.
  2. In the right pane of the Enterprise Library Configuration Console, or in the Visual Studio Properties window, select the Name property, and then change the default name to the name you want to use for the new matching rule.
  3. Select the Matches property, and then click the ellipsis button (...) to open the Match Collection Editor dialog box.
  4. Click Add and, in the right pane of the dialog box, enter the name of the target property (which can include square brackets, or the * or ? wildcard characters) you want this rule to select as the Value property.
  5. Select either True or False in the drop-down list for the IgnoreCase property.
  6. Select Get (match only read-only properties), Set (match only write-only properties), or GetOrSet (match all property types) in the drop-down list for the MatchOption property.
  7. Repeat steps 4, 5, and 6 to add all the property matches you require, and then click OK to close the Match Collection Editor dialog box.