ODataUtils.CreateAnnotationFilter Method

Translates the annotationFilter to a func that would evalutate whether the filter would match a given annotation name. The func would evaluate to true if the annotationFilter matches the annotation name that's passed to the it, and false otherwise.

Namespace:  Microsoft.Data.OData
Assembly:  Microsoft.Data.OData (in Microsoft.Data.OData.dll)

Syntax

'Declaration
Public Shared Function CreateAnnotationFilter ( _
    annotationFilter As String _
) As Func(Of String, Boolean)
'Usage
Dim annotationFilter As String 
Dim returnValue As Func(Of String, Boolean)

returnValue = ODataUtils.CreateAnnotationFilter(annotationFilter)
public static Func<string, bool> CreateAnnotationFilter(
    string annotationFilter
)
public:
static Func<String^, bool>^ CreateAnnotationFilter(
    String^ annotationFilter
)
static member CreateAnnotationFilter : 
        annotationFilter:string -> Func<string, bool> 
public static function CreateAnnotationFilter(
    annotationFilter : String
) : Func<String, boolean>

Parameters

  • annotationFilter
    Type: System.String
    The filter string may be a comma delimited list of any of the following supported patterns: "*" -- Matches all annotation names. "ns.*" -- Matches all annotation names under the namespace "ns". "ns.name" -- Matches only the annotation name "ns.name". "-" -- The exclude operator may be used with any of the supported pattern, for example: "-ns.*" -- Excludes all annotation names under the namespace "ns". "-ns.name" -- Excludes only the annotation name "ns.name". Null or empty filter is equivalent to "-*". The relative priority of the pattern is base on the relative specificity of the patterns being compared. If pattern1 is under the namespace pattern2, pattern1 is more specific than pattern2 because pattern1 matches a subset of what pattern2 matches. We give higher priority to the pattern that is more specific. For example: "ns.*" has higher priority than "*" "ns.name" has higher priority than "ns.*" "ns1.name" has same priority as "ns2.*" Patterns with the exclude operator takes higher precedence than the same pattern without. For example: "-ns.name" has higher priority than "ns.name". Examples: "ns1.*,ns.name" -- Matches any annotation name under the "ns1" namespace and the "ns.name" annotation. "*,-ns.*,ns.name" -- Matches any annotation name outside of the "ns" namespace and only "ns.name" under the "ns" namespace.

Return Value

Type: System.Func<String, Boolean>
Returns a func which would evaluate to true if the annotationFilter matches the annotation name that's passed to the it, and false otherwise.

See Also

Reference

ODataUtils Class

Microsoft.Data.OData Namespace