DatabaseCommand
Wraps a DbCommand and provides execution methods for database operations.
継承元: Disposable
プロパティ
public string CommandText { get; }
value = databaseCommand.CommandText
Gets the SQL command text.
public CommandType CommandType { get; }
value = databaseCommand.CommandType
Gets the command type (text, stored procedure, etc.).
public DbParameterCollection Parameters { get; }
value = databaseCommand.Parameters
Gets the collection of command parameters.
メソッド
protected override void DisposeManaged()
databaseCommand.DisposeManaged()
Disposes the managed resources. Override this method to add custom clean up of managed resources.
public ValueTask<int> ExecuteNonQuery(IEnumerable<SerializationItem> input, CancellationToken cancellationToken)
result = databaseCommand.ExecuteNonQuery(input, cancellationToken)
Executes the command and returns the number of rows affected.
public ValueTask<SerializationItemCollection> ExecuteRow(IEnumerable<SerializationItem> input, CancellationToken cancellationToken)
result = databaseCommand.ExecuteRow(input, cancellationToken)
Executes the command and returns the first result row as a serialization item collection.
public IAsyncEnumerable<SerializationItemCollection> ExecuteRowsAsync(SerializationItemCollection input, CancellationToken cancellationToken)
result = databaseCommand.ExecuteRowsAsync(input, cancellationToken)
Streams result rows one at a time without buffering the whole set in memory — preferred over CancellationToken) for queries that may return millions of rows.
public ValueTask<TScalar> ExecuteScalar<TScalar>(IEnumerable<SerializationItem> input, CancellationToken cancellationToken)
result = databaseCommand.ExecuteScalar(input, cancellationToken)
Executes the command and returns the first column of the first row as the specified type.
public ValueTask<SerializationItemCollection> ExecuteTable(SerializationItemCollection input, CancellationToken cancellationToken)
result = databaseCommand.ExecuteTable(input, cancellationToken)
Executes the command and returns all result rows as a columnar serialization item collection. Loads the entire result set into memory; for arbitrarily-large reads use CancellationToken).