Hi
The queries that I posted were taken by Fiddler so that's basically the raw web service calls to Salesforce - after all providers have worked their magic. I have narrowed down the possible cause to this difference:
1. Code like
Code: Select all
using (var ctx = new SalesforceEntities())
{
var user = ctx.Users.SingleOrDefault(x => x.Email == "[email protected]");
}
will generate this SQL in dbMonitor:
Code: Select all
SELECT Extent1.Id AS Id, Extent1.Email AS Email, ... FROM User AS Extent1 WHERE '[email protected]' = Extent1.Email LIMIT 2
which in turn will send the correct query to Salesforce WITH the WHERE clause:
2. Now, if I put the email into a variable instead of constant:
Code: Select all
using (var ctx = new SalesforceEntities())
{
var email = "[email protected]";
var user = ctx.Users.SingleOrDefault(x => x.Email == email);
}
it will generate this SQL in dbMonitor:
Code: Select all
SELECT Extent1.Id AS Id, Extent1.Email AS Email, ... FROM User AS Extent1 WHERE (Extent1.Email = :p__linq__0) AND (NOT (:p__linq__0 IS NULL)) LIMIT 2
with parameter p__linq__0, Input, String,
[email protected]
This will send a request to Salesforce WITHOUT the WHERE clause:
Code: Select all
<queryString>SELECT Id, Email, ... FROM User</queryString>
Can you please try to reproduce this issue or will I need to supply a test project?
Thanks