Method SetQueryIf
SetQueryIf(bool, string, string?)
Conditionally sets (removes and adds) a query parameter with a single value in the URL.
public UrlBuilder SetQueryIf(bool condition, string key, string? value)
Parameters
conditionboolThe condition under which the query parameter should be set.
keystringThe key of the query parameter.
valuestringThe value of the query parameter, or null to add an empty value.
Returns
- UrlBuilder
The current UrlBuilder instance, with the query parameter set if
conditionis true.
SetQueryIf(bool, string, params string?[])
Conditionally sets (removes and adds) a query parameter with multiple values in the URL.
public UrlBuilder SetQueryIf(bool condition, string key, params string?[] values)
Parameters
conditionboolThe condition under which the query parameter should be set.
keystringThe key of the query parameter.
valuesstring[]The values of the query parameter, or an array containing null values to add empty values.
Returns
- UrlBuilder
The current UrlBuilder instance, with the query parameter set if
conditionis true.
English
Русский
Português
Español
Deutsch
中文 (简体)
日本語