Skip to content

Commit

Permalink
Update Batch documentation with InheritDoc and Resolved Paths
Browse files Browse the repository at this point in the history
Re-generate NuGet API Documentation with InheritDoc Changes for cref References
  • Loading branch information
H-Yeo committed Feb 8, 2024
1 parent 040df88 commit a894493
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 79 deletions.
39 changes: 0 additions & 39 deletions doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> an
</format>
</remarks>
</ctor2>
<Timeout>
<inheritdoc cref="P:System.Data.Common.DbBatch.Timeout"/>
</Timeout>
<Connection>
<summary>
Gets or sets the
Expand Down Expand Up @@ -94,39 +91,6 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> an
</format>
</remarks>
</BatchCommands>
<DbBatchCommands>
<inheritdoc cref="P:Microsoft.Data.SqlClient.SqlBatch.DbBatchCommands"/>
</DbBatchCommands>
<DbConnection>
<inheritdoc cref="P:Microsoft.Data.SqlClient.SqlBatch.DbConnection"/>
</DbConnection>
<DbTransaction>
<inheritdoc cref="P:Microsoft.Data.SqlClient.SqlBatch.DbTransaction"/>
</DbTransaction>
<Cancel>
<inheritdoc cref="P:Microsoft.Data.SqlClient.SqlBatch.Cancel"/>
</Cancel>
<ExecuteNonQuery>
<inheritdoc cref="M:Microsoft.Data.SqlClient.SqlBatch.ExecuteNonQuery"/>
</ExecuteNonQuery>
<ExecuteNonQueryAsync>
<inheritdoc cref="M:Microsoft.Data.SqlClient.SqlBatch.ExecuteNonQueryAsync"/>
</ExecuteNonQueryAsync>
<ExecuteScalar>
<inheritdoc cref="M:Microsoft.Data.SqlClient.SqlBatch.ExecuteScalar"/>
</ExecuteScalar>
<ExecuteScalarAsync>
<inheritdoc cref="M:System.Data.Common.DbBatch.ExecuteScalarAsync"/>
</ExecuteScalarAsync>
<Prepare>
<inheritdoc cref="M:System.Data.Common.DbBatch.Prepare"/>
</Prepare>
<PrepareAsync>
<inheritdoc cref="M:System.Data.Common.DbBatch.PrepareAsync"/>
</PrepareAsync>
<ExecuteDbDataReader>
<inheritdoc cref="M:System.Data.Common.DbBatch.ExecuteDbDataReader"/>
</ExecuteDbDataReader>
<Commands>
<summary>
The list of commands contained in the batch in a
Expand Down Expand Up @@ -177,8 +141,5 @@ The following example creates a <xref:Microsoft.Data.SqlClient.SqlConnection> an
</format>
</remarks>
</ExecuteReaderAsync>
<CreateDbBatchCommand>
<inheritdoc/>
</CreateDbBatchCommand>
</members>
</docs>
35 changes: 14 additions & 21 deletions src/Microsoft.Data.SqlClient/ref/Microsoft.Data.SqlClient.Batch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,46 @@ public class SqlBatch : System.Data.Common.DbBatch
public SqlBatch() { throw null; }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ctor2/*'/>
public SqlBatch(Microsoft.Data.SqlClient.SqlConnection connection, Microsoft.Data.SqlClient.SqlTransaction transaction = null) { throw null; }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Timeout/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.Timeout"/>
public override int Timeout { get => throw null; set { } }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Connection/*'/>
public new Microsoft.Data.SqlClient.SqlConnection Connection { get => throw null; set { } }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Transaction/*'/>
public new Microsoft.Data.SqlClient.SqlTransaction Transaction { get => throw null; set { } }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/BatchCommands/*'/>
public new SqlBatchCommandCollection BatchCommands { get => throw null; }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/DbBatchCommands/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.DbBatchCommands"/>
protected override System.Data.Common.DbBatchCommandCollection DbBatchCommands { get => throw null; }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/DbConnection/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.DbConnection"/>
protected override System.Data.Common.DbConnection DbConnection { get => throw null; set { } }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/DbTransaction/*'/>
protected override System.Data.Common.DbTransaction DbTransaction { get => throw null; set { } }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Cancel/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.DbTransaction"/>
protected override System.Data.Common.DbTransaction DbTransaction { get => throw null; set { } }
/// <inheritdoc cref="System.Data.Common.DbBatch.Cancel"/>
public override void Cancel() => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteNonQuery/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteNonQuery"/>
public override int ExecuteNonQuery() => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteNonQueryAsync/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteNonQueryAsync(System.Threading.CancellationToken)"/>
public override System.Threading.Tasks.Task<int> ExecuteNonQueryAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteScalar/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteScalar"/>
public override object ExecuteScalar() => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteScalarAsync/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteScalarAsync(System.Threading.CancellationToken)"/>
public override System.Threading.Tasks.Task<object> ExecuteScalarAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Prepare/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.Prepare"/>
public override void Prepare() => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/PrepareAsync/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.PrepareAsync(System.Threading.CancellationToken)"/>
public override System.Threading.Tasks.Task PrepareAsync(System.Threading.CancellationToken cancellationToken = default) => throw null;


/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteDbDataReader(System.Data.CommandBehavior)"/>
protected override System.Data.Common.DbDataReader ExecuteDbDataReader(System.Data.CommandBehavior behavior) => throw null;

/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteDbDataReaderAsync(System.Data.CommandBehavior, System.Threading.CancellationToken)"/>
protected override System.Threading.Tasks.Task<System.Data.Common.DbDataReader> ExecuteDbDataReaderAsync(System.Data.CommandBehavior behavior, System.Threading.CancellationToken cancellationToken) => throw null;


/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Commands/*'/>
public System.Collections.Generic.List<Microsoft.Data.SqlClient.SqlBatchCommand> Commands { get { throw null; } }
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteReader/*'/>
public Microsoft.Data.SqlClient.SqlDataReader ExecuteReader() => throw null;
public Microsoft.Data.SqlClient.SqlDataReader ExecuteReader() => throw null;
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteReaderAsync/*'/>
public Microsoft.Data.SqlClient.SqlDataReader ExecuteReaderAsync() => throw null;

/// <inheritdoc/>
/// <inheritdoc cref="System.Data.Common.DbBatch.CreateDbBatchCommand"/>
protected override System.Data.Common.DbBatchCommand CreateDbBatchCommand() => throw null;

}
/// <include file='../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatchCommand.xml' path='docs/members[@name="SqlBatchCommand"]/SqlBatchCommand/*'/>
public partial class SqlBatchCommand : System.Data.Common.DbBatchCommand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#if NET6_0_OR_GREATER


using System.Collections.Generic;
using System.Data;
using System.Data.Common;
Expand Down Expand Up @@ -33,7 +32,7 @@ public SqlBatch(SqlConnection connection = null, SqlTransaction transaction = nu
Connection = connection;
Transaction = transaction;
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Timeout/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.Timeout"/>
public override int Timeout
{
get
Expand All @@ -47,11 +46,11 @@ public override int Timeout
_batchCommand.CommandTimeout = value;
}
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/DbBatchCommands/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.DbBatchCommands"/>
protected override DbBatchCommandCollection DbBatchCommands => BatchCommands;
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/BatchCommands/*'/>
public new SqlBatchCommandCollection BatchCommands => _providerCommands != null ? _providerCommands : _providerCommands = new SqlBatchCommandCollection(Commands); // Commands call will check disposed
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/DbConnection/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.DbConnection"/>
protected override DbConnection DbConnection
{
get
Expand All @@ -65,7 +64,7 @@ protected override DbConnection DbConnection
Connection = (SqlConnection)value;
}
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/DbTransaction/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.DbTransaction"/>
protected override DbTransaction DbTransaction
{
get
Expand All @@ -79,46 +78,46 @@ protected override DbTransaction DbTransaction
Transaction = (SqlTransaction)value;
}
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Cancel/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.Cancel"/>
public override void Cancel()
{
CheckDisposed();
_batchCommand.Cancel();
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteNonQuery/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteNonQuery"/>
public override int ExecuteNonQuery()
{
CheckDisposed();
SetupBatchCommandExecute();
return _batchCommand.ExecuteNonQuery();
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteNonQueryAsync/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteNonQueryAsync(System.Threading.CancellationToken)"/>
public override Task<int> ExecuteNonQueryAsync(CancellationToken cancellationToken = default)
{
CheckDisposed();
SetupBatchCommandExecute();
return _batchCommand.ExecuteNonQueryAsync(cancellationToken);
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteScalar/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteScalar"/>
public override object ExecuteScalar()
{
CheckDisposed();
SetupBatchCommandExecute();
return _batchCommand.ExecuteScalar();
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/ExecuteScalarAsync/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteScalarAsync(System.Threading.CancellationToken)"/>
public override Task<object> ExecuteScalarAsync(CancellationToken cancellationToken = default)
{
CheckDisposed();
SetupBatchCommandExecute();
return _batchCommand.ExecuteScalarBatchAsync(cancellationToken);
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/Prepare/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.Prepare"/>
public override void Prepare()
{
CheckDisposed();
}
/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBatch.xml' path='docs/members[@name="SqlBatch"]/PrepareAsync/*'/>
/// <inheritdoc cref="System.Data.Common.DbBatch.PrepareAsync(System.Threading.CancellationToken)"/>
public override Task PrepareAsync(CancellationToken cancellationToken = default)
{
CheckDisposed();
Expand Down Expand Up @@ -183,9 +182,7 @@ public SqlDataReader ExecuteReader()
CheckDisposed();
SetupBatchCommandExecute();
return _batchCommand.ExecuteReaderAsync(cancellationToken);
}


}
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteDbDataReader(System.Data.CommandBehavior)"/>
protected override DbDataReader ExecuteDbDataReader(CommandBehavior behavior) => ExecuteReader();
/// <inheritdoc cref="System.Data.Common.DbBatch.ExecuteDbDataReaderAsync(System.Data.CommandBehavior, System.Threading.CancellationToken)"/>
Expand All @@ -207,21 +204,18 @@ protected override Task<DbDataReader> ExecuteDbDataReaderAsync(CommandBehavior b
TaskScheduler.Default
);
}

/// <inheritdoc />
/// <inheritdoc cref="System.Data.Common.DbBatch.CreateDbBatchCommand"/>
protected override DbBatchCommand CreateDbBatchCommand()
{
return new SqlBatchCommand();
}

private void CheckDisposed()
{
if (_batchCommand is null)
{
throw ADP.ObjectDisposed(this);
}
}

private void SetupBatchCommandExecute()
{
SqlConnection connection = Connection;
Expand Down

0 comments on commit a894493

Please sign in to comment.