title: How does Dapper execute query without explicitly opening connection?
body: <p>We are using Dapper for some data access activity and are using the standard recommended approach for connecting to database as follows:</p>
  
  <pre><code>public static Func&lt;DbConnection&gt; ConnectionFactory = () =&gt; new SqlConnection(ConnectionString);
  </code></pre>
  
  <p>However, if we try and execute a statement, in the docs it show that you need to first state:</p>
  
  <pre><code>using (var conn = ConnectionFactory())
  {
     conn.Open();
     var result =  await conn.ExecuteAsync(sql, p, commandType: CommandType.StoredProcedure);
     return result;
  }
  </code></pre>
  
  <p>That means, you have to explicitly open the connection. However, if we leave out the statement <code>conn.open()</code>, it also works and we are worried if in such cases the connection may not be disposed of properly.</p>
  
  <p>I would appreciate any comments as to how the SQL gets executed <strong>without</strong> explicitly opening any connection.</p>