in an action I've instantiated my DbContext
through a using block:
using(var context = new DbContext())
{
//EF codes
}
inside the block, I'm making several queries to the database. I thought that using block
opens one connection and all queries use the same one connection.
but then I added Glimpse
and I see that there are 7 connections
not one! and no Transactions
.
what is wrong? did I misunderstand the DbContext behavior? or what ?
Update:
I just checked it with ExpressProfiler
and this is the result. after each command
there is a sp_reset_connection
.
Note : PSID
is the same (52) for all commands.
thanks in advance.