maybe its stupid question, but I confused my self. I use Dapper with Autofac (DI) and in my business layer I always use the following construction:
db.Open(); //db is IDbConnection instance
db.InsertOrDeleteOrUpdate(...)
db.Close();
whether a good solution to hide db.Open() and db.Close() by delegate method? For example:
dbHelper.do(db => db.InsertOrDeleteOrUpdate(...));
What do you do in such cases?