C# Класс Griffin.Data.Mapper.CommandBuilders.CommandBuilder

Base class for command builders
Creates SQL commands per the SQL92 standard. Inherit this class to customize different commands.
Наследование: ICommandBuilder
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
CommandBuilder ( ICrudEntityMapper mapper ) : System

Initializes a new instance of the CommandBuilder class.

DeleteCommand ( IDbCommand command, object entity ) : void

Modifies the command to execute a DELETE statement

InsertCommand ( IDbCommand command, object entity ) : void

Generate an insert command, should end with a command that returns the insert identity.

Paging ( IDbCommand command, int pageNumber, int pageSize ) : void

Modify SQL statement so that the result is paged.

TruncateCommand ( IDbCommand command ) : void

Truncate all rows in a table

Will do a DELETE statement

UpdateCommand ( IDbCommand command, object entity ) : void

Create an update query from the entity.

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

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

Initializes a new instance of the CommandBuilder class.
mapper
public CommandBuilder ( ICrudEntityMapper mapper ) : System
mapper ICrudEntityMapper The mapper.
Результат System

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

Modifies the command to execute a DELETE statement
/// command /// or /// entity ///
public DeleteCommand ( IDbCommand command, object entity ) : void
command IDbCommand Command that will be executed after this method call
entity object Only primary key properties are used in the WHERE clause
Результат void

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

Generate an insert command, should end with a command that returns the insert identity.
/// command /// or /// entity /// No values were added to the query for + entity
public InsertCommand ( IDbCommand command, object entity ) : void
command IDbCommand Command to add the query to
entity object Entity to store
Результат void

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

Modify SQL statement so that the result is paged.
public Paging ( IDbCommand command, int pageNumber, int pageSize ) : void
command IDbCommand Command to modify
pageNumber int One based index
pageSize int Items per page.
Результат void

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

Truncate all rows in a table
Will do a DELETE statement
command
public TruncateCommand ( IDbCommand command ) : void
command IDbCommand Command that will be executed after this method call
Результат void

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

Create an update query from the entity.
/// command /// or /// entity /// /// At least one property (other than primary keys) must be specified. /// or ///
public UpdateCommand ( IDbCommand command, object entity ) : void
command IDbCommand Command to modify
entity object Entity to update
Результат void