Class SimpleBuilderOptions
- Assembly
- Dapper.SimpleSqlBuilder.DependencyInjection.dll
An options class for configuring the builders settings.
public sealed class SimpleBuilderOptions
Inheritance
Fields
ConfigurationSectionName
The configuration section name for the builders settings.
public const string ConfigurationSectionName = "SimpleSqlBuilder"
Field Value
Properties
CollectionParameterTemplateFormat
Gets or sets the template format used to create collection parameter names for the generated SQL.
This template is used in conjunction with parameterNameTemplate to create parameter names for collections in the generated SQL.
The template must contain a single format placeholder {0}
which will be replaced with an incrementing number.
The default is c{0}_
; so if the parameterNameTemplate is p
, the collection parameter names will be generated as pc0_
, pc1_
, etc.
When expanded into multiple parameters by Dapper, pc0_
will be expanded to pc0_1
, pc0_2
, etc.
col{0}
will generate pcol0
, pcol1
, etc.
public string CollectionParameterTemplateFormat { get; set; }
Property Value
Exceptions
- ArgumentException
-
Thrown when the new value is null, Empty, white-space, or missing format placeholder.
DatabaseParameterNameTemplate
Gets or sets 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 as p0
, p1
, etc.
Example: Setting the template to param
will generate param0
, param1
, etc.
public string DatabaseParameterNameTemplate { get; set; }
Property Value
Exceptions
- ArgumentException
-
Thrown when the new value is null, Empty, or contains only white-space.
DatabaseParameterPrefix
Gets or sets the parameter prefix used in the rendered SQL. The default is @
, so you will get @p0
, @p1
, etc.
Example: Setting the parameter prefix to :
will generate :p0
, :p1
, etc.
public string DatabaseParameterPrefix { get; set; }
Property Value
Exceptions
- ArgumentException
-
Thrown when the new value is null, Empty, or contains only white-space.
ReuseParameters
Gets or sets the value indicating whether to reuse parameters or not. The default value is false.
Example: If set to true, parameters are reused; if set to false, they are not.
public bool ReuseParameters { get; set; }
Property Value
UseLowerCaseClauses
Gets or sets the value indicating whether SQL clauses should be in upper case or lower case. The default value is false, meaning SQL clauses will be in upper case (e.g., SELECT
, UPDATE
, etc.).
Example: If set to true, SQL clauses will be in lower case (e.g., select
, update
, etc.).
public bool UseLowerCaseClauses { get; set; }