diff --git a/doc/snippets/Microsoft.Data.Common/DbBatch.xml b/doc/snippets/Microsoft.Data.Common/DbBatch.xml deleted file mode 100644 index 1c9dcdd68b..0000000000 --- a/doc/snippets/Microsoft.Data.Common/DbBatch.xml +++ /dev/null @@ -1,651 +0,0 @@ - - - - - - - - - System.Object - - - - System.IAsyncDisposable - - - System.IDisposable - - - - - [System.Runtime.CompilerServices.Nullable(0)] - [<System.Runtime.CompilerServices.Nullable(0)>] - - - [System.Runtime.CompilerServices.NullableContext(1)] - [<System.Runtime.CompilerServices.NullableContext(1)>] - - - - Represents a batch of commands which can be executed against a data source in a single round trip. Provides a base class for database-specific classes that represent command batches. - - - - - - - - - - - Constructor - - - - Initializes a new instance of the class. - - To be added. - - - - - - Property - - System.Data.Common.DbBatchCommandCollection - - - - Gets the collection of objects. - - The commands contained within the batch. - To be added. - - - - - - Method - - System.Void - - - - - Attempts to cancel the execution of a . - - - - - - - - - - - - Property - - - [System.Runtime.CompilerServices.Nullable(2)] - [<System.Runtime.CompilerServices.Nullable(2)>] - - - [get: System.Runtime.CompilerServices.NullableContext(2)] - [<get: System.Runtime.CompilerServices.NullableContext(2)>] - - - [set: System.Runtime.CompilerServices.NullableContext(2)] - [<set: System.Runtime.CompilerServices.NullableContext(2)>] - - - - System.Data.Common.DbConnection - - - - Gets or sets the used by this . - - The connection to the data source. - To be added. - - - - - - Method - - System.Data.Common.DbBatchCommand - - - - - Creates a new instance of a object. - - - A object. - - To be added. - - - - - - Method - - System.Data.Common.DbBatchCommand - - - - - When overridden in a derived class, creates a new instance of a object. - - - A object. - - To be added. - - - - - - Property - - System.Data.Common.DbBatchCommandCollection - - - - When overridden in a derived class, gets the collection of objects. - - The commands contained within the batch. - To be added. - - - - - - Property - - - [System.Runtime.CompilerServices.Nullable(2)] - [<System.Runtime.CompilerServices.Nullable(2)>] - - - [get: System.Runtime.CompilerServices.NullableContext(2)] - [<get: System.Runtime.CompilerServices.NullableContext(2)>] - - - [set: System.Runtime.CompilerServices.NullableContext(2)] - [<set: System.Runtime.CompilerServices.NullableContext(2)>] - - - - System.Data.Common.DbConnection - - - - When overridden in a derived class, gets or sets the used by this . - - The connection to the data source. - To be added. - - - - - - Property - - - [System.Runtime.CompilerServices.Nullable(2)] - [<System.Runtime.CompilerServices.Nullable(2)>] - - - [get: System.Runtime.CompilerServices.NullableContext(2)] - [<get: System.Runtime.CompilerServices.NullableContext(2)>] - - - [set: System.Runtime.CompilerServices.NullableContext(2)] - [<set: System.Runtime.CompilerServices.NullableContext(2)>] - - - - System.Data.Common.DbTransaction - - - - When overridden in a derived class, gets or sets the within which this object executes. - - - The transaction within which a batch of a .NET data provider executes. The default value is a null reference ( in Visual Basic). - - To be added. - - - - - - Method - - M:System.IDisposable.Dispose - - - System.Void - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - To be added. - - - - - - Method - - M:System.IAsyncDisposable.DisposeAsync - - - System.Threading.Tasks.ValueTask - - - - Asynchronously diposes the batch object. - - A representing the asynchronous operation. - - - - , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - -]]> - - - - - - - - Method - - System.Data.Common.DbDataReader - - - - - - - An instance of , specifying options for batch execution and data retrieval. - - - When overridden in a derived class, executes the batch against its connection, returning a which can be used to access the results. - - - A object. - - - - can be used to advance the reader to the next result set. - - ]]> - - - An error occurred while executing the batch. - - The value is invalid. - - - - - - - Method - - System.Threading.Tasks.Task<System.Data.Common.DbDataReader> - - - - - - - One of the enumeration values that specifies options for batch execution and data retrieval. - A token to cancel the asynchronous operation. - - Providers should implement this method to provide a non-default implementation for overloads. - - The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteReader will be communicated via the returned Task Exception property. - - This method accepts a cancellation token that can be used to request the operation to be cancelled early. Implementations may ignore this request. - - A task representing the asynchronous operation. - - - , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - -]]> - - - - - - - - Method - - System.Int32 - - - - Executes the batch against its connection object, returning the total number of rows affected across all the batch commands. - The total number of rows affected across all the batch commands. - - - to perform catalog operations (for example, querying the structure of a database or creating database objects such as tables), or to change the data in a database by executing UPDATE, INSERT, or DELETE statements. - - Although does not return any rows, any output parameters or return values mapped to parameters are populated with data. - - For UPDATE, INSERT, and DELETE statements, the return value is the total number of rows affected by the batch. If no UPDATE, INSERT, or DELETE statements are included in the batch, the return value is -1. - - ]]> - - - - - - - - Method - - System.Threading.Tasks.Task<System.Int32> - - - - - - A token to cancel the asynchronous operation. - - This is the asynchronous version of . Providers should override with an appropriate implementation. The cancellation token may optionally be ignored. - - The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by will be communicated via the returned Task Exception property. - - Do not invoke other methods and properties of the object until the returned Task is complete. - - A task representing the asynchronous operation. - - - , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - -]]> - - - An error occurred while executing the batch. - ADO.NET Overview - - - - - - Method - - System.Data.Common.DbDataReader - - - - - - One of the enumeration values that specifies options for batch execution and data retrieval. - - Executes the batch against its connection, returning a which can be used to access the results. - - - A object. - - - - can be used to advance the reader to the next result set. - - ]]> - - - - - - - - Method - - System.Threading.Tasks.Task<System.Data.Common.DbDataReader> - - - - - - To be added. - - An asynchronous version of , which executes the batch against its connection, returning a which can be used to access the results. - - A task representing the asynchronous operation. - - - in . For more information about asynchronous programming, see [Asynchronous Programming](/dotnet/framework/data/adonet/asynchronous-programming). - - ]]> - - - An error occurred while executing the batch. - - The value is invalid. - - - - - - - Method - - System.Threading.Tasks.Task<System.Data.Common.DbDataReader> - - - - - - - One of the enumeration values that specifies options for batch execution and data retrieval. - A token to cancel the asynchronous operation. - - An asynchronous version of , which executes the batch against its connection, returning a which can be used to access the results. - - A task representing the asynchronous operation. - - - in . For more information about asynchronous programming, see [Asynchronous Programming](/dotnet/framework/data/adonet/asynchronous-programming). - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - -]]> - - - An error occurred while executing the batch. - - The value is invalid. - - - - - - - Method - - - [System.Runtime.CompilerServices.NullableContext(2)] - [<System.Runtime.CompilerServices.NullableContext(2)>] - - - - System.Object - - - - Executes the batch and returns the first column of the first row in the first returned result set. All other columns, rows and resultsets are ignored. - The first column of the first row in the first result set. - To be added. - An error occurred while executing the batch. - - - - - - Method - - System.Threading.Tasks.Task<System.Object> - - - - - - A token to cancel the asynchronous operation. - - An asynchronous version of , which executes the batch and returns the first column of the first row in the first returned result set. All other columns, rows and result sets are ignored. - - The first column of the first row in the first result set. - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - - An error occurred while executing the batch. - - - - - - Method - - System.Void - - - - Creates a prepared (or compiled) version of the batch, or of each of its commands, on the data source. - To be added. - - - - - - Method - - System.Threading.Tasks.Task - - - - - - - An optional token to cancel the asynchronous operation. The default value is . - - Asynchronously creates a prepared (or compiled) version of the batch, or of each of its commands, on the data source. - - A representing the asynchronous operation. - - - This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - - - - - - - Property - - System.Int32 - - - Gets or sets the wait time (in seconds) before terminating the attempt to execute the batch and generating an error. - The time in seconds to wait for the batch to execute. - - - is generated if the assigned property value is less than 0. - - Note to implementers: it's recommended that 0 mean no timeout. - - ]]> - - - - - - - - Property - - - [System.Runtime.CompilerServices.Nullable(2)] - [<System.Runtime.CompilerServices.Nullable(2)>] - - - [get: System.Runtime.CompilerServices.NullableContext(2)] - [<get: System.Runtime.CompilerServices.NullableContext(2)>] - - - [set: System.Runtime.CompilerServices.NullableContext(2)] - [<set: System.Runtime.CompilerServices.NullableContext(2)>] - - - - System.Data.Common.DbTransaction - - - - Gets or sets the within which this object executes. - - - The transaction within which a batch of a .NET data provider executes. The default value is a null reference ( in Visual Basic). - - To be added. - - - - diff --git a/doc/snippets/Microsoft.Data.Common/DbBatchCommand.xml b/doc/snippets/Microsoft.Data.Common/DbBatchCommand.xml deleted file mode 100644 index 68efa39676..0000000000 --- a/doc/snippets/Microsoft.Data.Common/DbBatchCommand.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - - System.Object - - - - - [System.Runtime.CompilerServices.Nullable(0)] - [<System.Runtime.CompilerServices.Nullable(0)>] - - - [System.Runtime.CompilerServices.NullableContext(1)] - [<System.Runtime.CompilerServices.NullableContext(1)>] - - - - - Represents a single command within a . A batch can be executed against a data source in a single round trip. - - To be added. - - - - - - Constructor - - - - Constructs an instance of the object. - - To be added. - - - - - - Property - - System.String - - - Gets or sets the text command to run against the data source. - The text command to execute. The default value is an empty string (""). - To be added. - - - - - - Property - - System.Data.CommandType - - - - Gets or sets how the property is interpreted. - - - One of the enumeration values that specifies how a command string is interpreted. The default is . - - To be added. - - - - - - Property - - System.Data.Common.DbParameterCollection - - - - Gets the collection of objects. - - The parameters of the SQL statement or stored procedure. - To be added. - - - - - - Property - - System.Data.Common.DbParameterCollection - - - - Gets the collection of objects. For more information on parameters, see [Configuring Parameters and Parameter Data Types](/dotnet/framework/data/adonet/configuring-parameters-and-parameter-data-types). - - The parameters of the SQL statement or stored procedure. - To be added. - - - - - - Property - - System.Int32 - - - - Gets the number of rows changed, inserted, or deleted by execution of this specific . - - The number of rows changed, inserted, or deleted. -1 for SELECT statements; 0 if no rows were affected or the statement failed. - To be added. - - - - diff --git a/doc/snippets/Microsoft.Data.Common/DbBatchCommandCollection.xml b/doc/snippets/Microsoft.Data.Common/DbBatchCommandCollection.xml deleted file mode 100644 index 610c7860f7..0000000000 --- a/doc/snippets/Microsoft.Data.Common/DbBatchCommandCollection.xml +++ /dev/null @@ -1,410 +0,0 @@ - - - - - System.Object - - - - System.Collections.Generic.ICollection<Microsoft.Data.Common.DbBatchCommand> - - - System.Collections.Generic.ICollection<T> - - - System.Collections.Generic.IEnumerable<Microsoft.Data.Common.DbBatchCommand> - - - System.Collections.Generic.IEnumerable<T> - - - System.Collections.Generic.IList<Microsoft.Data.Common.DbBatchCommand> - - - System.Collections.IEnumerable - - - - - [System.Runtime.CompilerServices.Nullable(0)] - [<System.Runtime.CompilerServices.Nullable(0)>] - - - [System.Runtime.CompilerServices.NullableContext(1)] - [<System.Runtime.CompilerServices.NullableContext(1)>] - - - - - The base class for a collection of instances of , contained in a . - - To be added. - - - - - Constructor - - - - Initializes a new instance of the class. - - To be added. - - - - - - Method - - M:System.Collections.Generic.ICollection`1.Add(`0) - - - System.Void - - - - - - - The object to add to the . - - - Adds the specified object to the . - - To be added. - - - - - - Method - - M:System.Collections.Generic.ICollection`1.Clear - - - System.Void - - - - - Removes all values from the . - - To be added. - - - - - - Method - - M:System.Collections.Generic.ICollection`1.Contains(`0) - - - System.Boolean - - - - - - - The object to locate in the . - - - Indicates whether a is contained in the collection. - - - if the is in the collection; otherwise . - - To be added. - - - - - - Method - - M:System.Collections.Generic.ICollection`1.CopyTo(`0[],System.Int32) - - - System.Void - - - - - - - - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - - - The zero-based index in at which copying begins. - - - Copies the elements of the to an , starting at a particular index. - - To be added. - - - - - - Property - - P:System.Collections.Generic.ICollection`1.Count - - - System.Int32 - - - - Gets the number of elements contained in the . - - - The number of elements contained in the . - - To be added. - - - - - - Method - - Microsoft.Data.Common.DbBatchCommand - - - - - - To be added. - To be added. - To be added. - To be added. - - - - - - Method - - M:System.Collections.Generic.IEnumerable`1.GetEnumerator - - - System.Collections.Generic.IEnumerator<Microsoft.Data.Common.DbBatchCommand> - - - - - Returns the object at the specified index in the collection. - - - The object at the specified index in the collection. - - To be added. - - - - - - Method - - M:System.Collections.Generic.IList`1.IndexOf(`0) - - - System.Int32 - - - - - - - The object to locate in the . - - - Returns the index of the specified object. - - - The index of the specified object. - - To be added. - - - - - - - - - - Method - - M:System.Collections.Generic.IList`1.Insert(System.Int32,`0) - - - System.Void - - - - - - - - The index at which to insert the object. - - - The object to insert into the . - - - Inserts the specified index of the object with the specified name into the collection at the specified index. - - To be added. - - - - - - Property - - P:System.Collections.Generic.ICollection`1.IsReadOnly - - - System.Boolean - - - Specifies whether the collection is read-only. - - if the collection is read-only; otherwise . - - To be added. - - - - - - Property - - P:System.Collections.Generic.IList`1.Item(System.Int32) - - - Microsoft.Data.Common.DbBatchCommand - - - - - - - The zero-based index of the . - - - Gets or sets the at the specified index. - - - The at the specified index. - - To be added. - The specified index does not exist. - - - - - - Method - - M:System.Collections.Generic.ICollection`1.Remove(`0) - - - System.Boolean - - - - - - - The object to remove from the . - - - Removes the specified object from the collection. - - - if was successfully removed; otherwise, . This method also returns if was not found in the . - - To be added. - - - - - - Method - - M:System.Collections.Generic.IList`1.RemoveAt(System.Int32) - - - System.Void - - - - - - - The index where the object is located. - - - Removes the object at the specified from the collection. - - To be added. - - - - - - Method - - System.Void - - - - - - - - The index where the object is located. - - To be added. - - Sets the object at the specified index to a new value. - - To be added. - - - - - - Method - - M:System.Collections.IEnumerable.GetEnumerator - - - System.Collections.IEnumerator - - - - Returns an enumerator that iterates through a collection. - - An object that can be used to iterate through the collection. - - - - instance is cast to an interface. - - ]]> - - - - - - diff --git a/doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml b/doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml index 4b8d1ffb05..18bb2de4a6 100644 --- a/doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml +++ b/doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml @@ -110,7 +110,7 @@ The following example creates a an - + @@ -126,10 +126,7 @@ The following example creates a an - - - - + The list of commands contained in the batch in a @@ -181,7 +178,7 @@ The following example creates a an - + diff --git a/src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.cs b/src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.cs index 16bab9af25..3ac52ee2a9 100644 --- a/src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.cs +++ b/src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.cs @@ -39,18 +39,25 @@ public class SqlBatch : System.Data.Common.DbBatch public override void Prepare() => throw null; /// public override System.Threading.Tasks.Task PrepareAsync(System.Threading.CancellationToken cancellationToken = default) => throw null; - /// + + + /// protected override System.Data.Common.DbDataReader ExecuteDbDataReader(System.Data.CommandBehavior behavior) => throw null; - /// + + /// protected override System.Threading.Tasks.Task ExecuteDbDataReaderAsync(System.Data.CommandBehavior behavior, System.Threading.CancellationToken cancellationToken) => throw null; + + /// public System.Collections.Generic.List Commands { get { throw null; } } /// public Microsoft.Data.SqlClient.SqlDataReader ExecuteReader() => throw null; /// public Microsoft.Data.SqlClient.SqlDataReader ExecuteReaderAsync() => throw null; - /// + + /// protected override System.Data.Common.DbBatchCommand CreateDbBatchCommand() => throw null; + } /// public partial class SqlBatchCommand : System.Data.Common.DbBatchCommand diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBatch.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBatch.cs index 52e8b73729..29f0d7cc61 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBatch.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBatch.cs @@ -184,9 +184,11 @@ public SqlDataReader ExecuteReader() SetupBatchCommandExecute(); return _batchCommand.ExecuteReaderAsync(cancellationToken); } - /// + + + /// protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) => ExecuteReader(); - /// + /// protected override Task ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) { CheckDisposed(); @@ -205,7 +207,8 @@ protected override Task ExecuteDbDataReaderAsync(CommandBehavior b TaskScheduler.Default ); } - /// + + /// protected override DbBatchCommand CreateDbBatchCommand() { return new SqlBatchCommand();