Q:

Why is LINQ expression causing two separate queries on the DB?

I have the following LINQ expression:
var rawData = ( from e in _man.Details
                 where e.Id == "G00"
                 select e).ToList();
which when I run with Profiler open I can see causes two separate identical queries.  What is the reason for this and how can this be prevented?

A:

Can you check what is the value in EventClass column in profiler. It probably is SQL:Batch Starting and SQL:Batch Completing (or something similar). Which does not mean 2 queries, but the start and end of execution of one query.

