C# Class Serenity.Data.SqlUpdate

Generates queries of the form UPDATE tablename SET field1 = value1, field2 = value2 ... fieldN = valueN WHERE [filter].

To determine updated field values, Set(field, value) should be called several times.

Where expressions determines the record(s) to update.

Inheritance: QueryWithParams, ISetFieldByStatement, IFilterableQuery
Afficher le fichier Open project: volkanceylan/Serenity Class Usage Examples

Méthodes publiques

Méthode Description
Clone ( ) : SqlUpdate

Clones this SqlUpdate query.

Dec ( IField field, int value ) : SqlUpdate

Decreases a fields value.

Dec ( string field, int value ) : SqlUpdate

Decreases a fields value.

Format ( string tableName, string where, List nameValuePairs ) : string

Formats an SQL UPDATE statement.

Inc ( IField field, int value ) : SqlUpdate

Increases a fields value.

Inc ( string field, int value ) : SqlUpdate

Increases a fields value.

RemoveT0Reference ( string expression ) : string
SetNull ( string field ) : SqlUpdate

Sets field value to NULL.

SetTo ( IField field, string value ) : SqlUpdate

Sets field value to the expression.

SetTo ( string field, string value ) : SqlUpdate

Sets field value to the expression.

SqlUpdate ( string tableName ) : System

Creates a new SqlUpdate query.

ToString ( ) : string

Gets string representation of SqlUpdate query.

Where ( ) : SqlUpdate

Adds conditions to WHERE clause of the query.

Where ( string condition ) : SqlUpdate

Adds a condition to WHERE clause of the query.

Private Methods

Méthode Description
IFilterableQuery ( string condition ) : void

Adds a condition to WHERE clause of the query.

ISetFieldByStatement ( string field, string value ) : void

Sets field value to the expression.

Initialize ( string tableName ) : void

Method Details

Clone() public méthode

Clones this SqlUpdate query.
public Clone ( ) : SqlUpdate
Résultat SqlUpdate

Dec() public méthode

Decreases a fields value.
public Dec ( IField field, int value ) : SqlUpdate
field IField /// Field (required).
value int /// Decrease amount (can be negative).
Résultat SqlUpdate

Dec() public méthode

Decreases a fields value.
public Dec ( string field, int value ) : SqlUpdate
field string /// Field name (required).
value int /// Decrease amount (can be negative).
Résultat SqlUpdate

Format() public static méthode

Formats an SQL UPDATE statement.
public static Format ( string tableName, string where, List nameValuePairs ) : string
tableName string /// Tablename (required).
where string /// WHERE clause (can be null).
nameValuePairs List /// Field name and values. Should have structure of [field1, value1, field2, value2, ...., fieldN, valueN]. /// This array is required and must have even number of elements.
Résultat string

Inc() public méthode

Increases a fields value.
public Inc ( IField field, int value ) : SqlUpdate
field IField /// Field (required).
value int /// Increase amount (can be negative).
Résultat SqlUpdate

Inc() public méthode

Increases a fields value.
public Inc ( string field, int value ) : SqlUpdate
field string /// Field name (required).
value int /// Increase amount (can be negative).
Résultat SqlUpdate

RemoveT0Reference() public static méthode

public static RemoveT0Reference ( string expression ) : string
expression string
Résultat string

SetNull() public méthode

Sets field value to NULL.
public SetNull ( string field ) : SqlUpdate
field string /// Field (required).
Résultat SqlUpdate

SetTo() public méthode

Sets field value to the expression.
public SetTo ( IField field, string value ) : SqlUpdate
field IField /// Field name (required).
value string /// Field expression (required).
Résultat SqlUpdate

SetTo() public méthode

Sets field value to the expression.
public SetTo ( string field, string value ) : SqlUpdate
field string /// Field name (required).
value string /// Field value (expression, required).
Résultat SqlUpdate

SqlUpdate() public méthode

Creates a new SqlUpdate query.
public SqlUpdate ( string tableName ) : System
tableName string /// Tablename (required).
Résultat System

ToString() public méthode

Gets string representation of SqlUpdate query.
public ToString ( ) : string
Résultat string

Where() public méthode

Adds conditions to WHERE clause of the query.
public Where ( ) : SqlUpdate
Résultat SqlUpdate

Where() public méthode

Adds a condition to WHERE clause of the query.
public Where ( string condition ) : SqlUpdate
condition string /// Condition.
Résultat SqlUpdate