Class SqlParameterCollectorBase

Assembly: redb.Core.dll

Base class for SQL parameter collection.
Provides value normalization and debug output.
Uses ISqlDialect for dialect-specific parameter formatting.

public class SqlParameterCollectorBase

Inheritance

ObjectSqlParameterCollectorBase

Properties

Count

Number of parameters added.

public int Count { get; }

Methods

AddParameter(object?)

Adds a parameter and returns the dialect-specific placeholder.

public string AddParameter(object? value)

AddParameterWithOffset(object?, int)

Adds a parameter with a custom index offset.

public string AddParameterWithOffset(object? value, int offset)

FormatForComment(object?)

Formats value for debug comment.

protected virtual string FormatForComment(object? value)

GetDebugComment()

Generates debug comment with parameter values (EF Core style).

public string GetDebugComment()

NormalizeValue(object?)

Normalizes value before adding to parameters.

protected virtual object? NormalizeValue(object? value)

SetSchemeId(long)

Sets SchemeId for debug output.

public void SetSchemeId(long schemeId)

ToArray()

Returns parameters as array for use with FromSqlRaw/SqlQueryRaw.

public object?[] ToArray()

Constructors

SqlParameterCollectorBase(ISqlDialect)

Creates a new parameter collector with the specified SQL dialect.