C# Класс BF2Statistics.Database.QueryBuilder.UpdateQueryBuilder

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Table string

Защищенные свойства (Protected)

Свойство Тип Описание
Driver DatabaseDriver
Fields FieldValuePair>.Dictionary
WhereStatement WhereStatement

Открытые методы

Метод Описание
AddWhere ( string field, Comparison @operator, object compareValue ) : WhereClause
AddWhere ( WhereClause Clause ) : void
BuildCommand ( ) : DbCommand

Builds the query string with the current SQL Statement, and returns the DbCommand to be executed. All WHERE paramenters are propery escaped, making this command SQL Injection safe.

BuildQuery ( ) : string

Builds the query string with the current SQL Statement, and returns the querystring. This method is NOT Sql Injection safe!

Execute ( ) : int

Executes the command against the database. The database driver must be set!

SetDbDriver ( DatabaseDriver Driver ) : void

Sets the database driver

SetField ( string Field, object Value ) : void

Sets a value for the specified field

SetField ( string Field, object Value, ValueMode Mode ) : void

Sets a value for the specified field

SetTable ( string Table ) : void

Sets the table name to update

SetWhereOperator ( LogicOperator @Operator ) : void

Sets the Logic Operator for the WHERE statement

UpdateQueryBuilder ( DatabaseDriver Driver ) : System

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.

UpdateQueryBuilder ( string Table, DatabaseDriver Driver ) : System

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.

Защищенные методы

Метод Описание
BuildQuery ( bool BuildCommand ) : object

Builds the query string or DbCommand

GetSign ( ValueMode Mode ) : string

Returns the sign for the given value mode

Описание методов

AddWhere() публичный Метод

public AddWhere ( string field, Comparison @operator, object compareValue ) : WhereClause
field string
@operator Comparison
compareValue object
Результат WhereClause

AddWhere() публичный Метод

public AddWhere ( WhereClause Clause ) : void
Clause WhereClause
Результат void

BuildCommand() публичный Метод

Builds the query string with the current SQL Statement, and returns the DbCommand to be executed. All WHERE paramenters are propery escaped, making this command SQL Injection safe.
public BuildCommand ( ) : DbCommand
Результат System.Data.Common.DbCommand

BuildQuery() защищенный Метод

Builds the query string or DbCommand
protected BuildQuery ( bool BuildCommand ) : object
BuildCommand bool
Результат object

BuildQuery() публичный Метод

Builds the query string with the current SQL Statement, and returns the querystring. This method is NOT Sql Injection safe!
public BuildQuery ( ) : string
Результат string

Execute() публичный Метод

Executes the command against the database. The database driver must be set!
public Execute ( ) : int
Результат int

GetSign() защищенный Метод

Returns the sign for the given value mode
protected GetSign ( ValueMode Mode ) : string
Mode ValueMode
Результат string

SetDbDriver() публичный Метод

Sets the database driver
public SetDbDriver ( DatabaseDriver Driver ) : void
Driver DatabaseDriver
Результат void

SetField() публичный Метод

Sets a value for the specified field
public SetField ( string Field, object Value ) : void
Field string The column or field name
Value object The new value to update
Результат void

SetField() публичный Метод

Sets a value for the specified field
public SetField ( string Field, object Value, ValueMode Mode ) : void
Field string The column or field name
Value object The new value to update
Mode ValueMode Sets how the update value will be applied to the existing field value
Результат void

SetTable() публичный Метод

Sets the table name to update
public SetTable ( string Table ) : void
Table string The name of the table to update
Результат void

SetWhereOperator() публичный Метод

Sets the Logic Operator for the WHERE statement
public SetWhereOperator ( LogicOperator @Operator ) : void
@Operator LogicOperator
Результат void

UpdateQueryBuilder() публичный Метод

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.
public UpdateQueryBuilder ( DatabaseDriver Driver ) : System
Driver DatabaseDriver The DatabaseDriver that will be used to query this SQL statement
Результат System

UpdateQueryBuilder() публичный Метод

Creates a new instance of UpdateQueryBuilder with the provided Database Driver.
public UpdateQueryBuilder ( string Table, DatabaseDriver Driver ) : System
Table string The table we are updating
Driver DatabaseDriver The DatabaseDriver that will be used to query this SQL statement
Результат System

Описание свойств

Driver защищенное свойство

The database driver, if using the "BuildCommand" method
protected DatabaseDriver Driver
Результат DatabaseDriver

Fields защищенное свойство

A list of FieldValuePairs
protected Dictionary Fields
Результат FieldValuePair>.Dictionary

Table публичное свойство

The table name to query
public string Table
Результат string

WhereStatement защищенное свойство

Query's where statement
protected WhereStatement WhereStatement
Результат WhereStatement