You shouldn’t be using Request Scope for pooled resources like IDbConnection
as it holds the open connection when it’s not needed, just inject the IDbConnectionFactory
and use it in a scope:
public IDbConnectionFactory DbFactory { get; set; }
//...
using var db = DbFactory.Open();
//...
Although for multitenancy-aware dependencies like IDbConnection
its best to retrieve it from:
using var db = HostContext.AppHost.GetDbConnection(Request);
//...