Skip to content

Commit

Permalink
use nameof() for ArgumentException
Browse files Browse the repository at this point in the history
replace <devdoc> with <summary>
remove trailing whitespace.
#39
  • Loading branch information
tsahi committed Jan 1, 2021
1 parent d26e0b3 commit 2059527
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions source/Src/Data.Oracle/OracleDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ namespace Microsoft.Practices.EnterpriseLibrary.Data.Oracle
/// <summary>
/// <para>Represents an Oracle database.</para>
/// </summary>
/// <remarks>
/// <remarks>
/// <para>
/// Internally uses Oracle .NET Managed Provider from Oracle to connect to a Oracle database.
/// </para>
/// </para>
/// <para>
/// When retrieving a result set, it will build the package name. The package name should be set based
/// on the stored procedure prefix and this should be set via configuration. For
/// on the stored procedure prefix and this should be set via configuration. For
/// example, a package name should be set as prefix of "ENTLIB_" and package name of
/// "pkgENTLIB_ARCHITECTURE". For your applications, this is required only if you are defining your stored procedures returning
/// "pkgENTLIB_ARCHITECTURE". For your applications, this is required only if you are defining your stored procedures returning
/// ref cursors.
/// </para>
/// </remarks>
Expand Down Expand Up @@ -55,7 +55,7 @@ public OracleDatabase(string connectionString)
public OracleDatabase(string connectionString, IEnumerable<IOraclePackage> packages)
: base(connectionString, OracleClientFactory.Instance)
{
if (packages == null) throw new ArgumentNullException("packages");
if (packages == null) throw new ArgumentNullException(nameof(packages));

this.packages = packages;
}
Expand All @@ -74,7 +74,7 @@ public OracleDatabase(string connectionString, IEnumerable<IOraclePackage> packa
/// <param name="scale"><para>The number of decimal places to which <paramref name="value"/> is resolved.</para></param>
/// <param name="sourceColumn"><para>The name of the source column mapped to the DataSet and used for loading or returning the <paramref name="value"/>.</para></param>
/// <param name="sourceVersion"><para>One of the <see cref="DataRowVersion"/> values.</para></param>
/// <param name="value"><para>The value of the parameter.</para></param>
/// <param name="value"><para>The value of the parameter.</para></param>
public override void AddParameter(DbCommand command, string name, DbType dbType, int size,
ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn,
DataRowVersion sourceVersion, object value)
Expand Down Expand Up @@ -110,13 +110,13 @@ public override void AddParameter(DbCommand command, string name, DbType dbType,
/// <param name="scale"><para>The number of decimal places to which <paramref name="value"/> is resolved.</para></param>
/// <param name="sourceColumn"><para>The name of the source column mapped to the DataSet and used for loading or returning the <paramref name="value"/>.</para></param>
/// <param name="sourceVersion"><para>One of the <see cref="DataRowVersion"/> values.</para></param>
/// <param name="value"><para>The value of the parameter.</para></param>
/// <param name="value"><para>The value of the parameter.</para></param>
#pragma warning disable 612, 618
public void AddParameter(OracleCommand command, string name, OracleDbType oracleType, int size,
ParameterDirection direction, bool nullable, byte precision, byte scale, string sourceColumn,
DataRowVersion sourceVersion, object value)
{
if (command == null) throw new ArgumentNullException("command");
if (command == null) throw new ArgumentNullException(nameof(command));

OracleParameter param = CreateParameter(name, DbType.AnsiString, size, direction, nullable, precision, scale, sourceColumn, sourceVersion, value) as OracleParameter;
param.OracleDbType = oracleType;
Expand All @@ -127,8 +127,8 @@ public void AddParameter(OracleCommand command, string name, OracleDbType oracle
/// <summary>
/// Creates an <see cref="OracleDataReader"/> based on the <paramref name="command"/>.
/// </summary>
/// <param name="command">The command wrapper to execute.</param>
/// <returns>An <see cref="OracleDataReader"/> object.</returns>
/// <param name="command">The command wrapper to execute.</param>
/// <returns>An <see cref="OracleDataReader"/> object.</returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="command"/> can not be <see langword="null"/> (Nothing in Visual Basic).</para>
/// </exception>
Expand All @@ -153,9 +153,9 @@ protected override IDataReader CreateWrappedReader(DatabaseConnectionWrapper con

/// <summary>
/// <para>Creates an <see cref="OracleDataReader"/> based on the <paramref name="command"/>.</para>
/// </summary>
/// <param name="command"><para>The command wrapper to execute.</para></param>
/// <param name="transaction"><para>The transaction to participate in when executing this reader.</para></param>
/// </summary>
/// <param name="command"><para>The command wrapper to execute.</para></param>
/// <param name="transaction"><para>The transaction to participate in when executing this reader.</para></param>
/// <returns><para>An <see cref="OracleDataReader"/> object.</para></returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="command"/> can not be <see langword="null"/> (Nothing in Visual Basic).</para>
Expand Down Expand Up @@ -186,7 +186,7 @@ public override DataSet ExecuteDataSet(DbCommand command)
/// <para>Executes a command and returns the result in a new <see cref="DataSet"/>.</para>
/// </summary>
/// <param name="command"><para>The command to execute to fill the <see cref="DataSet"/></para></param>
/// <param name="transaction"><para>The transaction to participate in when executing this reader.</para></param>
/// <param name="transaction"><para>The transaction to participate in when executing this reader.</para></param>
/// <returns><para>A <see cref="DataSet"/> filed with records and, if necessary, schema.</para></returns>
/// <exception cref="ArgumentNullException">
/// <para><paramref name="command"/> can not be <see langword="null"/> (<b>Nothing</b> in Visual Basic).</para>
Expand Down Expand Up @@ -249,7 +249,7 @@ public override void LoadDataSet(DbCommand command, DataSet dataSet, string[] ta
/// <returns>The value of the parameter.</returns>
public override object GetParameterValue(DbCommand command, string parameterName)
{
if (command == null) throw new ArgumentNullException("command");
if (command == null) throw new ArgumentNullException(nameof(command));

object convertedValue = base.GetParameterValue(command, parameterName);

Expand Down Expand Up @@ -282,7 +282,7 @@ public override object GetParameterValue(DbCommand command, string parameterName
/// <param name="value">The parameter value.</param>
public override void SetParameterValue(DbCommand command, string parameterName, object value)
{
if (command == null) throw new ArgumentNullException("command");
if (command == null) throw new ArgumentNullException(nameof(command));

object convertedValue = value;

Expand All @@ -303,17 +303,17 @@ public override void SetParameterValue(DbCommand command, string parameterName,
base.SetParameterValue(command, parameterName, convertedValue);
}

/// <devdoc>
/// <summary>
/// This is a private method that will build the Oracle package name if your stored procedure
/// has proper prefix and postfix.
/// has proper prefix and postfix.
/// This functionality is include for
/// the portability of the architecture between SQL and Oracle database.
/// This method also adds the reference cursor to the command writer if not already added. This
/// is required for Oracle .NET managed data provider.
/// </devdoc>
/// </summary>
private void PrepareCWRefCursor(DbCommand command)
{
if (command == null) throw new ArgumentNullException("command");
if (command == null) throw new ArgumentNullException(nameof(command));

if (CommandType.StoredProcedure == command.CommandType)
{
Expand Down Expand Up @@ -414,7 +414,7 @@ public override bool SupportsParemeterDiscovery
}

/// <summary>
/// Retrieves parameter information from the stored procedure specified in the <see cref="DbCommand"/> and populates the Parameters collection of the specified <see cref="DbCommand"/> object.
/// Retrieves parameter information from the stored procedure specified in the <see cref="DbCommand"/> and populates the Parameters collection of the specified <see cref="DbCommand"/> object.
/// </summary>
/// <param name="discoveryCommand">The <see cref="DbCommand"/> to do the discovery.</param>
/// <remarks>
Expand All @@ -435,7 +435,7 @@ protected override void DeriveParameters(DbCommand discoveryCommand)
/// <returns><para>The <see cref="DbCommand"/> for the stored procedure.</para></returns>
/// <remarks>
/// <para>The parameters for the stored procedure will be discovered and the values are assigned in positional order.</para>
/// </remarks>
/// </remarks>
public override DbCommand GetStoredProcCommand(string storedProcedureName, params object[] parameterValues)
{
// need to do this before of eventual parameter discovery
Expand All @@ -451,7 +451,7 @@ public override DbCommand GetStoredProcCommand(string storedProcedureName, param
/// <param name="parameterValues">The parameter values that will be assigned to the command.</param>
public override void AssignParameters(DbCommand command, object[] parameterValues)
{
if (command == null) throw new ArgumentNullException("command");
if (command == null) throw new ArgumentNullException(nameof(command));

// need to do this before of eventual parameter discovery
string updatedStoredProcedureName = TranslatePackageSchema(command.CommandText);
Expand All @@ -461,11 +461,11 @@ public override void AssignParameters(DbCommand command, object[] parameterValue
/// <summary>
/// <para>Creates a <see cref="DbCommand"/> for a stored procedure.</para>
/// </summary>
/// <param name="storedProcedureName"><para>The name of the stored procedure.</para></param>
/// <param name="storedProcedureName"><para>The name of the stored procedure.</para></param>
/// <returns><para>The <see cref="DbCommand"/> for the stored procedure.</para></returns>
/// <remarks>
/// <para>The parameters for the stored procedure will be discovered and the values are assigned in positional order.</para>
/// </remarks>
/// </remarks>
public override DbCommand GetStoredProcCommand(string storedProcedureName)
{
// need to do this before of eventual parameter discovery
Expand All @@ -474,10 +474,10 @@ public override DbCommand GetStoredProcCommand(string storedProcedureName)
return command;
}

/// <devdoc>
/// <summary>
/// Looks into configuration and gets the information on how the command wrapper should be updated if calling a package on this
/// connection.
/// </devdoc>
/// </summary>
private string TranslatePackageSchema(string storedProcedureName)
{
const string allPrefix = "*";
Expand Down

0 comments on commit 2059527

Please sign in to comment.