Struct BuilderFactoryInterpolatedStringHandler
- Assembly
- Dapper.SimpleSqlBuilder.DependencyInjection.dll
A handler used by the language compiler to create the Builder and append interpolated strings into Builder instances.
public ref struct BuilderFactoryInterpolatedStringHandler
Constructors
BuilderFactoryInterpolatedStringHandler(int, int, ISimpleBuilder)
Initializes a new instance of the BuilderFactoryInterpolatedStringHandler struct.
public BuilderFactoryInterpolatedStringHandler(int literalLength, int formattedCount, ISimpleBuilder builderFactory)
Parameters
literalLength
int-
The number of constant characters outside of interpolation expressions in the interpolated string.
formattedCount
int-
The number of interpolation expressions in the interpolated string.
builderFactory
ISimpleBuilder-
The ISimpleBuilder object for creating builder instances.
Exceptions
- ArgumentNullException
-
Thrown when
builderFactory
is null. - InvalidOperationException
-
Thrown when created builder does not implement IBuilderFormatter.
Methods
AppendFormatted<T>(T)
Appends a value to the builder.
public void AppendFormatted<T>(T value)
Parameters
value
T-
The value to append.
Type Parameters
T
-
The type of the value.
AppendFormatted<T>(T, string?)
Appends a value to the builder.
public void AppendFormatted<T>(T value, string? format)
Parameters
value
T-
The value to append.
format
string?-
The format string for the value.
Type Parameters
T
-
The type of the value.
AppendLiteral(string)
Appends a string to the builder.
public void AppendLiteral(string value)
Parameters
value
string-
The string to append.