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

Commit 8cd546b

Browse files
committed
Handle SQL replace when IN array is empty
1 parent 7bc1157 commit 8cd546b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ServiceStack.OrmLite/OrmLiteReadCommandExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ internal static IDbCommand SetParameters(this IDbCommand dbCmd, Type type, objec
180180
}
181181

182182
var sqlIn = StringBuilderCache.ReturnAndFree(sb);
183+
if (string.IsNullOrEmpty(sqlIn))
184+
sqlIn = "NULL";
183185
sqlCopy = sqlCopy?.Replace(dialectProvider.ParamString + propName, sqlIn);
184186
if (dialectProvider.ParamString != "@")
185187
sqlCopy = sqlCopy?.Replace("@" + propName, sqlIn);

0 commit comments

Comments
 (0)