Page 1 of 1

Parameters of DbCommand not populated (bug?)

Posted: Thu 08 Oct 2009 09:23
by edwin
Hello,

I have the following problem (example code):

var query = context.Chauffeurs.Where(x => x.Id == 42);
int i = context.GetCommand(query).Parameters.Count;

In this case, the context.GetCommand(query) should give you a DbCommand that has a Parameters collection with one parameter, for the 42, but instead the Parameters collection is empty (i==0), resulting in an error on execute:

ORA-01008: not all variables bound

When you inspect context.GetCommand(query).CommandText you see the parameter :p0

"SELECT t1.ID, t1.NAAM\r\nFROM Z9C_JUIST.CHAUFFEUR t1\r\nWHERE t1.ID = :p0"

Anyone any idea how I can get the Parameters collection to automatically populate from an IQueryable?

Kind regards,

Edwin.

Posted: Fri 09 Oct 2009 12:59
by AndreyR
Thank you for the report.
I will let you know as soon as the problem is fixed.

Posted: Tue 13 Oct 2009 07:43
by AndreyR
We have fixed the problem. Look forward to the nearest buid.