Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit aa2f940

Browse files
committed
Support for Trim functions
Support for Trim functions
1 parent c296e0d commit aa2f940

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ServiceStack.OrmLite/Expressions/SqlExpressionVisitor.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,15 @@ protected virtual object VisitColumnAccessMethod(MethodCallExpression m)
11671167

11681168
switch (m.Method.Name)
11691169
{
1170+
case "Trim":
1171+
statement = string.Format("ltrim(rtrim({0}))", quotedColName);
1172+
break;
1173+
case "LTrim":
1174+
statement = string.Format("ltrim({0})", quotedColName);
1175+
break;
1176+
case "RTrim":
1177+
statement = string.Format("rtrim({0})", quotedColName);
1178+
break;
11701179
case "ToUpper":
11711180
statement = string.Format("upper({0})", quotedColName);
11721181
break;

0 commit comments

Comments
 (0)