public SqlConnectionPoolManager(SqlConnectionPoolManagerOptions options) { _pools = new ConcurrentDictionary <string, ConcurrentQueue <PooledDbConnectionWrapper> >(); _connInfos = new ConcurrentDictionary <Guid, ConnectionInfo>(); _poolOptions = new ConcurrentDictionary <string, ConnectionPoolOptions>(); _poolsLock = new object(); _options = options; }
public static IServiceCollection AddSqlConnectionPoolManager(this IServiceCollection services, out IDbConnectionPoolManager connPoolManager, Action <SqlConnectionPoolManagerOptions> configAction = null, Action <IDbConnectionPoolManager> initAction = null) { var options = new SqlConnectionPoolManagerOptions(); configAction?.Invoke(options); connPoolManager = new SqlConnectionPoolManager(options); initAction?.Invoke(connPoolManager); return(services.AddSingleton(connPoolManager)); }