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(); }
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(); }