Skip to content

ParametersBuilder Class

Provides a builder for constructing and manipulating query strings or URI fragment parts.

C#
public class ParametersBuilder

Inheritance System.Object → ParametersBuilder

Constructors

ParametersBuilder(string) Constructor

Initializes a new instance of the ParametersBuilder class.

C#
public ParametersBuilder(string valuesString="");

Parameters

valuesString System.String

A string representing the initial query string or URI fragment.

Properties

ParametersBuilder.this[string] Property

The value associated with the specified parameter name.

C#
public string? this[string name] { get; set; }

Parameters

name System.String

The name of the parameter to get or set.

Property Value

System.String

Methods

ParametersBuilder.Add(string, string) Method

Appends a value under a name, keeping any value already stored under it.

C#
public void Add(string name, string? value);

Parameters

name System.String

The name of the parameter to append to.

value System.String

The value to append.

Remarks

The indexer replaces, which is what almost every parameter wants. This is for the few that a specification allows to repeat (resource of RFC 8707, for one), where each occurrence carries its own meaning and replacing would silently drop all but the last.

ParametersBuilder.Clear() Method

Clears all the parameters from the builder.

C#
public void Clear();

ParametersBuilder.ToString() Method

Returns a string that represents the current query string or URI fragment.

C#
public override string ToString();

Returns

System.String
A string that represents the current state of the builder.