Class SimpleBuilderSettings
- Namespace
- Dapper.SimpleSqlBuilder
- Assembly
- Dapper.SimpleSqlBuilder.dll
Global settings for the builders.
public sealed class SimpleBuilderSettings
Inheritance
Properties
DatabaseParameterNameTemplate
Gets the parameter name template used to create the parameter names for the generated SQL.
public string DatabaseParameterNameTemplate { get; }
Property Value
DatabaseParameterPrefix
Gets the parameter prefix used in the rendered SQL.
public string DatabaseParameterPrefix { get; }
Property Value
Instance
Singleton instance to access the builders settings.
public static SimpleBuilderSettings Instance { get; }
Property Value
ReuseParameters
Gets the value indicating whether to reuse parameters or not.
public bool ReuseParameters { get; }
Property Value
UseLowerCaseClauses
Get the value indicating whether SQL clauses should be in upper case or lower case.
public bool UseLowerCaseClauses { get; }
Property Value
Methods
Configure(string?, string?, bool?, bool?)
Configures the builders settings. Null or empty arguments will be ignored.
public static void Configure(string? parameterNameTemplate = null, string? parameterPrefix = null, bool? reuseParameters = null, bool? useLowerCaseClauses = null)
Parameters
parameterNameTemplate
string?-
The parameter name template used to create the parameter names for the generated SQL. The default is
p
, so the parameter names will be generated asp0
,p1
, etc.Example: If you set the template to
param
, it will generateparam0
,param1
, etc. parameterPrefix
string?-
The parameter prefix used in the rendered SQL. The default is
@
, so you will get@p0
,@p1
, etc.Example: If you set the parameter prefix to
:
, it will generate:p0
,:p1
, etc. reuseParameters
bool?-
The value indicating whether to reuse parameters or not. The default value is false.
Example: If set to true parameters are reused and if set false to they are not.
useLowerCaseClauses
bool?-
The value indicating whether to use lower case clauses for the fluent builder. The default value is false meaning SQL clauses will be in upper cases. i.e.
SELECT
,UPDATE
, etc.Example: If set to true, SQL clauses will be in lower cases i.e.
select
,update
, etc.The
useLowerCaseClauses
is only applicable to the fluent builder.