Class UriTemplateExtensions
Helpers for handling URI templates.
Inheritance
System.Object
UriTemplateExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: DocuWare.Services.Http.Client
Assembly: DocuWare.RestClient.dll
Syntax
public static class UriTemplateExtensions
Methods
CreateUrl(IEnumerable<UriTemplateDescription>, String, IEnumerable<KeyValuePair<String, Object>>)
Creates the URL for the specified template and binds parameters.
Declaration
public static string CreateUrl(this IEnumerable<UriTemplateDescription> templates, string templateName, IEnumerable<KeyValuePair<string, object>> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<UriTemplateDescription> | templates | The templates. |
System.String | templateName | Name of the template. |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>> | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.String | The URL with bound parameters. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The specified template '{0}' cannot be found.;templateName |
CreateUrl(IEnumerable<UriTemplateDescription>, String, Object)
Creates the URL for the specified template and binds parameters.
Declaration
public static string CreateUrl(this IEnumerable<UriTemplateDescription> templates, string templateName, object parameters)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<UriTemplateDescription> | templates | The templates. |
System.String | templateName | Name of the template. |
System.Object | parameters | The parameters. |
Returns
Type | Description |
---|---|
System.String | The URL with bound parameters. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | The specified template '{0}' cannot be found.;templateName |
FindTemplate(IEnumerable<UriTemplateDescription>, String)
Finds the specified URI template from the list.
Declaration
public static UriTemplateDescription FindTemplate(this IEnumerable<UriTemplateDescription> templates, string templateName)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<UriTemplateDescription> | templates | The templates. |
System.String | templateName | Name of the template. |
Returns
Type | Description |
---|---|
UriTemplateDescription |