コード例 #1
0
ファイル: ConnectionFactory.cs プロジェクト: ywscr/Vulcan
        public static IDbConnection CreateDefaultDbConnection(string connectionString)
        {
            if (_default != null)
            {
                return(_default.CreateDbConnection(connectionString));
            }

            throw new NullReferenceException("默认的IConnectionFactory没有设置,请在应用程序启动时设置");
        }
コード例 #2
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");
        }