Is my Entity Framework generated SQL twice?

I am considering a performance analysis of SQL created from Entity Framework 1 using MS SQL 2008.

When I run the trace in SQL Server Profiler 2008, I noticed something that I did not expect. For every query I execute, I get two statements RPC:Completedseparated by a character exec sp_reset_connection statement. Is this expected behavior?

SQL Server Profiler Results

+5
source share
1 answer

Answer: Yes

Turns out it was a “feature” in AutoMapper that was causing my problem.

See here: When matching IQueryable, I see that the database hits my profiler twice.

, 1.1 (.net 3.5), .

: .ToList() IQueryable, Mapper.Map(). Mapper .

+2

All Articles