示例#1
0
        internal ConnectionManager(IConnectionFactory factory, string connectionString, IRuntimeContextStorage ctxStorage)
        {
            _dbConnectionString = connectionString;
            _ctxStorage         = ctxStorage;

            _connection = factory.CreateDbConnection(connectionString);

            if (_connection.State != ConnectionState.Open)
            {
                _connection.Open();
            }

            _uuid = new Guid().ToString("N");
        }
示例#2
0
 public ConnectionManagerFactory(IRuntimeContextStorage ctxStorage, IConnectionFactory factory)
 {
     _ctxStorage    = ctxStorage ?? throw new ArgumentNullException(nameof(ctxStorage));
     _defautFactory = factory ?? throw new ArgumentNullException(nameof(factory));
 }