Link Search Menu Expand Document

RightTrimQueryField


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

Usability

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

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

The result would contain all the records where the right-trimmed value of Column is equals to Value.

GetString

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

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