I'm changing our DAL to an async
DAL.
Looking at :
await _conn.OpenAsync().ConfigureAwait(false);
I see that there's an async
method for open connection.But why there's no async method for closing connection ?
- A shared connection might used by others
- Might return to the connection pool
- It is an I/O operation
- Possible delayed / time-consuming operation
(I might be wrong about all four above :-))
Question
It seems logic ( to me) that there's should be an async close
method for a connection.
Is there a reason why there's not ?
PS I will obviously will use DAPPER at the end , but just for practicing , I've decided to create small mini mini dapper alike DAL.
DBConnection
are you referring to?DBConnection
is not actually asynchronous. InSqlConnection
however, it is.