C# Класс Serenity.Data.SqlInsert

Class to generate queries of the form INSERT INTO tablename (field1, field2..fieldN) VALUES (value1, value2..valueN)
Наследование: QueryWithParams, ISetFieldByStatement
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
Clone ( ) : SqlInsert

Clones the query.

Format ( string tableName, List nameValuePairs ) : string

Formats an INSERT query.

IdentityColumn ( string value ) : SqlInsert
IdentityColumn ( ) : string
SetNull ( string field ) : SqlInsert

Assigns NULL as the field value.

SetTo ( IField field, string value ) : SqlInsert

Sets field value.

SetTo ( string field, string value ) : SqlInsert

Sets field value.

SqlInsert ( string tableName ) : System

Creates a new SqlInsert query.

ToString ( ) : string

Gets string representation of the query.

Приватные методы

Метод Описание
ISetFieldByStatement ( string field, string value ) : void

Sets field value.

Initialize ( string tableName ) : void

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

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

Clones the query.
public Clone ( ) : SqlInsert
Результат SqlInsert

Format() публичный статический Метод

Formats an INSERT query.
public static Format ( string tableName, List nameValuePairs ) : string
tableName string /// Tablename (required).
nameValuePairs List /// Field names and values. Must be passed in the order of [field1, value1, field2, /// value2, ...., fieldN, valueN]. It must have even number of elements.
Результат string

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

public IdentityColumn ( string value ) : SqlInsert
value string
Результат SqlInsert

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

public IdentityColumn ( ) : string
Результат string

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

Assigns NULL as the field value.
public SetNull ( string field ) : SqlInsert
field string /// Field (required).
Результат SqlInsert

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

Sets field value.
public SetTo ( IField field, string value ) : SqlInsert
field IField /// Field (required).
value string /// Field value (expression, required).
Результат SqlInsert

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

Sets field value.
public SetTo ( string field, string value ) : SqlInsert
field string /// Field name (required).
value string /// Field value (expression, required).
Результат SqlInsert

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

Creates a new SqlInsert query.
public SqlInsert ( string tableName ) : System
tableName string /// Table to insert record (required).
Результат System

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

Gets string representation of the query.
public ToString ( ) : string
Результат string