SqlRawBuilder Class
.NET Standard 2.x
Represents an object which only uses raw SQL and SQL parameters to build a SQL statement.
Namespace: SnapObjects.Data
Assembly: SnapObjects.Data.dll
Implements
SnapObjects.Data.SqlBuilderBase
SnapObjects.Data.ISqlRawBuilder
Syntax
public class SqlRawBuilder : SqlBuilderBase, ISqlRawBuilder;
Constructors
Name | Description |
---|---|
SqlRawBuilder(string name = "") | Initializes a new instance of the SqlRawBuilder class. |
Properties
Name | Return Type | Description |
---|---|---|
Name | string | Gets the name of the current object. |
SqlType | SqlStatementType | Gets the SQL statement type of the current object. |
UsedParameters | IReadOnlyDictionary<string, ISqlParameter> | Gets an IReadOnlyDictionary<string, ISqlParameter> object that contains all parameters used in the current object. |
Methods
Name | Return Type | Description |
---|---|---|
AddParameters(params ISqlParameter[] parameters) | bool | Adds the parameters which will be used in the SQL statement to the current object. |
Clone() | ISqlBuilder | Makes a copy of the current ISqlBuilder object. |
GetParameterPlacehold(string name) | ISqlParameter[] | Gets the placeholder string for a SQL parameter. |
Raw(string sqlText, params ISqlParameter[] parameters) | ISqlBuilder | Creates a SQL statement by the raw SQL and SQL parameters. |
Reset() | ISqlBuilder | Clears the SQL statement and all of the SQL parameters defined in the current object. |
ToReadOnly() | ISqlReadOnlyBuilder | Gets a read-only ISqlReadOnlyBuilder object generated by the clone of the current object. |
ToSqlString(DataContext context) | string | Returns the raw SQL string for the corresponding database by the current object. |
Validate(DataContext context, bool throwError = true) | bool | Validates the raw SQL string for the specified database generated by the current SqlBuilder. |