Link Search Menu Expand Document

LeftQueryField


An extended query field class for defining SQL expressions using the LEFT function. Inherits QueryField.

Usability

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

The result contains all records where Column starts with Value.

GetString

The GetString() method returns the command text using the LEFT function.

var where = new LeftQueryField("Column", "Value");
var text = where.GetString(connection.GetDbSetting()); // Returns (LEFT([Column]) = @Column)