UriTemplate.PathSegmentVariableNames Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets a collection of variable names used within path segments in the template.

Namespace:   System
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

Public ReadOnly Property PathSegmentVariableNames As ReadOnlyCollection(Of String)

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection(Of String)

A collection of variable names that appear within the template's path segment.

The collection excludes the names of variables that appear in the query portion of the template.

The following example shows how to access the PathSegmentVariableNames property.

Dim template As UriTemplate = New UriTemplate("weather/{state}/{city}?forecast={day}")

Dim prefix As Uri = New Uri("http://localhost")

Console.WriteLine("PathSegmentVariableNames:")
For Each name As String In template.PathSegmentVariableNames
    Console.WriteLine("     {0}", name)
Next

.NET Framework
Available since 3.5
Silverlight
Available since 4.0
Return to top
Show: