SALES: 1-800-867-1380
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

UriTemplate.PathSegmentVariableNames Property

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

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

public ReadOnlyCollection<string> PathSegmentVariableNames { get; }

Property Value

Type: System.Collections.ObjectModel.ReadOnlyCollection<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.

UriTemplate template = new UriTemplate("weather/{state}/{city}?forecast={day}");

Uri prefix = new Uri("http://localhost");

Console.WriteLine("PathSegmentVariableNames:");
foreach (string name in template.PathSegmentVariableNames)
{
    Console.WriteLine("     {0}", name);
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft