UriUtility.FromPattern method (1 of 3)

Builds a URI from a pattern and an object containing parameters.

public static Uri FromPattern(string uriPattern, 
    IEnumerable<KeyValuePair<string, object?>> parameters)
parameter description
uriPattern The pattern.
parameters The parameters.

Return Value

Each value is converted to a string with the invariant culture; see the other overload for more details.

See Also


UriUtility.FromPattern method (2 of 3)

Builds a URI from a pattern and parameters.

public static Uri FromPattern(string uriPattern, 
    IEnumerable<KeyValuePair<string, string?>> parameters)
parameter description
uriPattern The pattern.
parameters The parameters.

Return Value

This method looks for “{key}” in the pattern, where “key” is one of the keys in the list of parameters, and replaces the key with the corresponding value, properly encoded for the URI. Any parameter that doesn’t appear in the pattern is added to the end of the URI as a query parameter. The same key must not appear multiple times in the pattern or in the list of parameters (the behavior is undefined). If the key or value is null, the pair is ignored.

See Also


UriUtility.FromPattern method (3 of 3)

Builds a URI from a pattern and parameters.

public static Uri FromPattern(string uriPattern, params string[] parameters)
parameter description
uriPattern The pattern.
parameters The parameters.

Return Value

Each pair of parameters represents a key and a value; see the other overload for details.

See Also