C# Class Serenity.Data.SqlInsert

Class to generate queries of the form INSERT INTO tablename (field1, field2..fieldN) VALUES (value1, value2..valueN)
Inheritance: QueryWithParams, ISetFieldByStatement
Mostrar archivo Open project: volkanceylan/Serenity Class Usage Examples

Public Methods

Method Description
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.

Private Methods

Method Description
ISetFieldByStatement ( string field, string value ) : void

Sets field value.

Initialize ( string tableName ) : void

Method Details

Clone() public method

Clones the query.
public Clone ( ) : SqlInsert
return SqlInsert

Format() public static method

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.
return string

IdentityColumn() public method

public IdentityColumn ( string value ) : SqlInsert
value string
return SqlInsert

IdentityColumn() public method

public IdentityColumn ( ) : string
return string

SetNull() public method

Assigns NULL as the field value.
public SetNull ( string field ) : SqlInsert
field string /// Field (required).
return SqlInsert

SetTo() public method

Sets field value.
public SetTo ( IField field, string value ) : SqlInsert
field IField /// Field (required).
value string /// Field value (expression, required).
return SqlInsert

SetTo() public method

Sets field value.
public SetTo ( string field, string value ) : SqlInsert
field string /// Field name (required).
value string /// Field value (expression, required).
return SqlInsert

SqlInsert() public method

Creates a new SqlInsert query.
public SqlInsert ( string tableName ) : System
tableName string /// Table to insert record (required).
return System

ToString() public method

Gets string representation of the query.
public ToString ( ) : string
return string