The title pretty much says it all. Since Dapper does not have much documentation. Thanks in advance.
Query() returns IEnumerable. When you start to iterate over your IEnumerable, inside Dapper some method is called with Yield to fill a POCO with a line of results, so your results are materialized progressively as you iterate over them. You need to keep the DB connection open as you do this, because you're not guaranteed that all lines of the result set come back at once. Indeed for large result sets, you want to be able to loop through them without ever having the whole result set in memory in the app. At any point, you can call ToList() on your IEnumerable, and then you've materialized everything, and you can close your connection.