Link Search Menu Expand Document

LowerQueryField


An extended query field class that is being used to define a query expression for the SQL statement using the LOWER function. It inherits the QueryField object.

Usability

Below is a sample code on how to use this class.

var where = new LowerQueryField("Column", "value");
var result = connection.Query<Entity>(where);

The result would contain all the records where the lowercase value of the Column is equals to value.

GetString

The GetString() method returns a command text that utilizes the LOWER function.

var where = new LowerQueryField("Column", "value");
var text = where.GetString(connection.GetDbSetting()); // Returns (LOWER([Column]) = @Column)