Sisk

Method

UrlBuilder.AddQueryIf

Namespace
Sisk.Core.Helpers
Assembly
Sisk.Core.dll

AddQueryIf(string, string?[], bool) #

Conditionally adds a query parameter with multiple values to the URL.

C#
public UrlBuilder AddQueryIf(string key, string?[] values, bool condition)

Parameters #

key string

The key of the query parameter.

values string?[]

The values of the query parameter, or an array containing null values to add empty values.

condition bool

The condition under which the query parameter should be added.

Returns #

UrlBuilder

The current UrlBuilder instance, with the query parameter added if condition is true.

Type to search the documentation and the API reference.