WebGetAttribute.UriTemplate Property

Definition

Gets or sets the Uniform Resource Identifier (URI) template for the service operation.

C#
public string UriTemplate { get; set; }

Property Value

The URI template for the service operation.

Examples

The following example shows how to set the UriTemplate property.

C#
[OperationContract]
[WebGet(UriTemplate = "Sub?x={x}&y={y}")]
long Subtract(long x, long y);

Remarks

URI templates are used to determine which requests get dispatched to which service operations. URI templates allow you to map a URI or a set of URIs to a service operation. For more information about URI templates, see UriTemplate and UriTemplateTable.

Applies to

Product Versions
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1