protected JetCommand(JetCommand source) { #if DEBUG Interlocked.Increment(ref _activeObjectsCount); #endif _connection = source._connection; _transaction = source._transaction; InnerCommand = (DbCommand)((ICloneable)source.InnerCommand).Clone(); }
/// <summary> /// Initializes a new instance of the <see cref="JetCommand"/> class. /// </summary> /// <param name="commandText">The command text.</param> /// <param name="connection">The connection.</param> /// <param name="transaction">The transaction.</param> internal JetCommand(JetConnection connection, string commandText = null, JetTransaction transaction = null) { #if DEBUG Interlocked.Increment(ref _activeObjectsCount); #endif _connection = connection ?? throw new ArgumentNullException(nameof(connection)); _transaction = transaction; InnerCommand = connection.JetFactory.InnerFactory.CreateCommand(); InnerCommand.CommandText = commandText; }