예제 #1
0
        public DbContext(string connectionSeting)
        {
            _connectionSeting = connectionSeting;
            Connection        = new SqlConnection(_connectionSeting);

            if (Connection == null)
            {
                throw new Exception("Connection为null");
            }

            DatabaseType = GetDataBaseType.GetDbType("System.Data.SqlClient");

            InitConnection();
        }
예제 #2
0
        public DbContext(string connectionSeting, ITransaction tran, bool isWrite = true)
        {
            _connectionSeting = connectionSeting;
            Connection        = new SqlConnection(_connectionSeting.ToString());

            if (Connection == null)
            {
                throw new Exception("Connection为null");
            }

            DatabaseType = GetDataBaseType.GetDbType("System.Data.SqlClient");

            transaction = tran;
            InitConnection();
        }