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. |
Each value is converted to a string with the invariant culture; see the other overload for more details.
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. |
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.
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. |
Each pair of parameters represents a key and a value; see the other overload for details.