Bad sql (single quoted) generated using EF with dynamic linq
Posted: Thu 30 Dec 2010 22:14
SELECT count(*)
FROM dbo.someTable
WHERE 'parameter ' = '3'
This is not valid sql for postgre, but executes without an error.
However, when i put the parameter in double quotes, i get the needed results:
"parameter" = '3'
The query is generated using EF code only.
DbModel.Set().AsQueryable().Where(" @0 == @1 ", paramName = "parameter ", paramValueAsString = "3").Count();
The where is an Extension method from:
http://weblogs.asp.net/scottgu/archive/ ... brary.aspx
I'm using Devart provider 5.00.28 icw postgresql 9.0.
Withing the dynamic where a CreateQuery is done by scottgu.
Here is some debug information:
source.Expression.DebugView:
.Call .Constant(System.Data.Objects.ObjectQuery`1[FundaDomain.Domain.WoningObject]).MergeAs(.Constant(AppendOnly))
lambda.Body.DebugView:
"aantalkamers" == "3"
But still the parameter (here: aantalkamers) in the generated sql is put in single quotes.
If one needs more information please let me know.
Kind regards.
FROM dbo.someTable
WHERE 'parameter ' = '3'
This is not valid sql for postgre, but executes without an error.
However, when i put the parameter in double quotes, i get the needed results:
"parameter" = '3'
The query is generated using EF code only.
DbModel.Set().AsQueryable().Where(" @0 == @1 ", paramName = "parameter ", paramValueAsString = "3").Count();
The where is an Extension method from:
http://weblogs.asp.net/scottgu/archive/ ... brary.aspx
I'm using Devart provider 5.00.28 icw postgresql 9.0.
Withing the dynamic where a CreateQuery is done by scottgu.
Here is some debug information:
source.Expression.DebugView:
.Call .Constant(System.Data.Objects.ObjectQuery`1[FundaDomain.Domain.WoningObject]).MergeAs(.Constant(AppendOnly))
lambda.Body.DebugView:
"aantalkamers" == "3"
But still the parameter (here: aantalkamers) in the generated sql is put in single quotes.
If one needs more information please let me know.
Kind regards.