I have a strange problem where executing a Linq to SQL query is taking 2 mins, but if I get the query and execute it directly it takes only 2 secs. So in code I would like to be able to a work around this issue like this:
DataContext db = new DataContext();
var query = db.Sales.Where(....);
var result = db.ExecuteQuery<Sale>(query.ToString(), p1, p2, p3);
So does anyone know how to retrieve the parameters from a Linq expression? Otherwise it looks like I'll just have to write this query by hand.
...
Go to the complete details ...