WhereIn converting int32 values to question marks??? #659
-
The call to WhereIn is pretty simple: filterModel.Value is of type object filterModel.Value is assigned a List before reaching this code
But for some reason the resulting condition in my SQL string has (?, ?) instead of (1, 2). Using intellisense I can see that everything in the query object looks correct, the values are integers. Any insight as to why the values are being output as question marks? EDIT Just for funsies I tried the following
and that produced: WHERE [A].[StatusID] IN (?, ?) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I believe I found the cause. The query was paramtizing all the values being used in the where clauses, so looking at the CompiledQuery.SQL you can see those where clauses as WHERE [A].[StatusID] IN (@p0, @p1) I am building this query entirely free of outside user input so I don't have to fear injection concerns, so I can work around this by replacing the params with their values in the resulting SQL string. If there isn't a way to turn off that parameterization that would be a nice feature to add. |
Beta Was this translation helpful? Give feedback.
I believe I found the cause. The query was paramtizing all the values being used in the where clauses, so looking at the CompiledQuery.SQL you can see those where clauses as WHERE [A].[StatusID] IN (@p0, @p1)
I am building this query entirely free of outside user input so I don't have to fear injection concerns, so I can work around this by replacing the params with their values in the resulting SQL string. If there isn't a way to turn off that parameterization that would be a nice feature to add.