Class StringVariableHandler
Escapes and injects a string literal directly into the SQL text.
public class StringVariableHandler : IQuerySegmentHandler
- Inheritance
-
StringVariableHandler
- Implements
- Inherited Members
- Extension Methods
Remarks
Wraps the provided value in single quotes and doubles every single quote inside it, so the literal the
value produces is the value and nothing more. If the value is not a string, it performs a
ToString() conversion. Use this for values that should be treated as SQL string literals.
Constructors
StringVariableHandler()
Escapes and injects a string literal directly into the SQL text.
public StringVariableHandler()
Remarks
Wraps the provided value in single quotes and doubles every single quote inside it, so the literal the
value produces is the value and nothing more. If the value is not a string, it performs a
ToString() conversion. Use this for values that should be treated as SQL string literals.
Fields
Instance
Singleton for StringVariableHandler
public static readonly StringVariableHandler Instance
Field Value
Methods
Build(string)
Used to create a HandlerGetter<T> delegate.
public static StringVariableHandler Build(string _)
Parameters
_string
Returns
Handle(ref ValueStringBuilder, object)
Writes the SQL for value into the query being built.
public void Handle(ref ValueStringBuilder sb, object value)
Parameters
sbValueStringBuilderThe builder the query is being assembled in.
valueobjectThe value bound to this spot for the current run.