QueryGenerationManager Class
Manages the generation of SQL queries for data operations by delegating the query generation tasks to an implementation of the IQueryGenerator interface.
Namespace
DbSyncKit.Templates
Interfaces
Base Types
  • object
graph BT Type-->Base0["object"] Type-.->Interface0["IQueryGenerator"] click Interface0 "/api/DbSyncKit.Templates.Interface/IQueryGenerator" Type-.->Interface1["IDisposable"] Type["QueryGenerationManager"] class Type type-node

Syntax

public class QueryGenerationManager : IQueryGenerator, IDisposable

Remarks

This class acts as a wrapper around an instance of IQueryGenerator and forwards query generation requests to the underlying implementation.

Constructors

Name Summary
QueryGenerationManager(IQueryGenerator) The underlying query generator instance used for actual query generation.

Methods

Name Return Value Summary
Dispose() void
EscapeColumn(string) string
Escapes the input column name to be used safely in SQL queries.
EscapeValue(object) object
Escapes special characters in the input to make it SQL-safe.
GenerateBatchSeparator() string
Generates a SQL batch separator ('GO' statement in SQL Server) used to execute batches of SQL statements.
GenerateComment(string) string
Generates a SQL comment.
GenerateDeleteQuery<T>(T, List<string>) string
Generates a DELETE query for deleting data from a database table.
GenerateInsertQuery<T>(T, List<string>, List<string>) string
Generates an INSERT query for inserting data into a database table.
GenerateSelectQuery<T>(string, List<string>, string) string
Generates a SELECT query for retrieving data from a database table.
GenerateUpdateQuery<T>(T, List<string>, List<string>, (string propName, object propValue)[]) string
Generates an UPDATE query for updating data in a database table.
GetCondition<T>(T, List<string>) List<string>
Gets a condition for use in a SQL WHERE clause based on the entity and key columns.