C# Класс MicroLite.SqlUtility

A utility class containing useful methods for manipulating SQL.
Показать файл Открыть проект

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

Метод Описание
GetFirstParameterPosition ( string commandText ) : int

Gets the position of the first parameter in the specified SQL command text.

GetParameterNames ( string commandText ) : IList

Gets the parameter names from the specified SQL command text or an empty list if the command text does not contain any named parameters.

Will return an empty list if the command text has no parameter names or the parameter names are all '?' (if the dialect does not support named parameters).

RenumberParameters ( string sql, int totalArgumentCount ) : string

Re-numbers the parameters in the SQL based upon the total number of arguments.

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

Метод Описание
GetParameterPosition ( string commandText, int position, char matchParameterIdentifiers ) : int

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

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

Gets the position of the first parameter in the specified SQL command text.
Thrown if commandText is null.
public static GetFirstParameterPosition ( string commandText ) : int
commandText string The SQL command text.
Результат int

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

Gets the parameter names from the specified SQL command text or an empty list if the command text does not contain any named parameters.
Will return an empty list if the command text has no parameter names or the parameter names are all '?' (if the dialect does not support named parameters).
Thrown if commandText is null.
public static GetParameterNames ( string commandText ) : IList
commandText string The SQL command text.
Результат IList

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

Re-numbers the parameters in the SQL based upon the total number of arguments.
public static RenumberParameters ( string sql, int totalArgumentCount ) : string
sql string The SQL.
totalArgumentCount int The total number of arguments.
Результат string