<PackageReference Include="Refit" Version="16.2.0" />

Refit.GeneratedQueryStringBuilder

Appends query parameters to a relative request path without reflection, matching the escaping, ordering, null-omission and collection-format semantics of the reflection request builder. Used by source-generated request construction; the API is also callable directly by hand-written AOT-friendly clients.
public GeneratedQueryStringBuilder(string relativePath)

Initializes a new instance of the GeneratedQueryStringBuilder struct.

public GeneratedQueryStringBuilder(string relativePath, bool hasQuery)

Initializes a new instance of the GeneratedQueryStringBuilder struct with a known query state.

public void Add(string name, string value, bool preEncoded)

Appends one key=value query parameter.

public void AddCollectionValue(string value)

Appends one formatted element of the current collection.

public void AddFlag(string name, bool preEncoded)

Appends one valueless query flag (?name).

public void AddPreEscapedKey(string name, string value, bool preEncoded)

Appends one key=value query parameter whose key the generator already escaped.

public void BeginCollection(string name, CollectionFormat collectionFormat, bool preEncoded)

Starts a collection-valued parameter fed by AddCollectionValue calls and finished by EndCollection.

public string Build()

Builds the final relative path with the appended query string and releases pooled buffers.

public void EndCollection()

Finishes the current collection, emitting the joined key=value pair for non-multi formats.