Skip to content
Documentation

SqlParameterFactory<TParameter> Class

Abstract base class for SQL parameter factories that handles parameter-name prefixing.

public abstract class SqlParameterFactory<TParameter> : HAKOM.Persistence.Sql.Net.Api.ISqlParameterFactory<TParameter>
where TParameter : HAKOM.Persistence.Sql.Net.Api.ISqlParameter

TParameter

The SQL parameter type this factory produces.

Inheritance System.Object 🡒 SqlParameterFactory<TParameter>

Implements HAKOM.Persistence.Sql.Net.Api.ISqlParameterFactory<TParameter>

Derived classes override Create<TValue>(string, TValue) to construct the provider-specific parameter type. The ParameterPrefix defaults to @ and can be overridden (e.g. Oracle uses :).

SqlParameterFactory<TParameter>.ParameterPrefix Property

Section titled “SqlParameterFactory<TParameter>.ParameterPrefix Property”

Gets the prefix character(s) prepended to parameter names (e.g. @ for SQL Server/PostgreSQL or : for Oracle).

public virtual string ParameterPrefix { get; }

Implements ParameterPrefix

System.String

SqlParameterFactory<TParameter>.AddPrefixToName(string) Method

Section titled “SqlParameterFactory<TParameter>.AddPrefixToName(string) Method”

Ensures the parameter name starts with the ParameterPrefix. If it already does, the name is returned unchanged.

protected string AddPrefixToName(string name);

name System.String

The parameter name to prefix.

System.String
The prefixed parameter name.

System.ArgumentException
Thrown when name is null or whitespace.

SqlParameterFactory<TParameter>.Create<TValue>(string, TValue) Method

Section titled “SqlParameterFactory<TParameter>.Create<TValue>(string, TValue) Method”

Creates a new SQL parameter with the given name and value.

public abstract TParameter Create<TValue>(string name, TValue value);

TValue

The CLR type of the parameter value.

name System.String

The parameter name, with or without the provider-specific prefix.

value TValue

The value to bind to the parameter.

Implements Create<TValue>(string, TValue)

TParameter
A new TParameter instance ready to be added to a command.

© 2026 Volue.Version v0.6.38017 November 2026