From b005a154f0a5f69e93521376c60e2630ebecdb55 Mon Sep 17 00:00:00 2001 From: Davoud Eshtehari Date: Thu, 30 Sep 2021 17:59:18 -0700 Subject: [PATCH] remove IsDirectionValid --- .../Data/Common/AdapterUtilCommon.cs | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtilCommon.cs b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtilCommon.cs index 1a866db79f..45c2044d52 100644 --- a/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtilCommon.cs +++ b/src/Microsoft.Data.SqlClient/src/Microsoft/Data/Common/AdapterUtilCommon.cs @@ -592,24 +592,18 @@ internal static Transaction GetCurrentTransaction() internal static bool IsDirection(DbParameter value, ParameterDirection condition) { #if DEBUG - IsDirectionValid(condition); + switch (condition) + { // @perfnote: Enum.IsDefined + case ParameterDirection.Input: + case ParameterDirection.Output: + case ParameterDirection.InputOutput: + case ParameterDirection.ReturnValue: + break; + default: + throw ADP.InvalidParameterDirection(condition); + } #endif return (condition == (condition & value.Direction)); - - // local function - static void IsDirectionValid(ParameterDirection value) - { - switch (value) - { // @perfnote: Enum.IsDefined - case ParameterDirection.Input: - case ParameterDirection.Output: - case ParameterDirection.InputOutput: - case ParameterDirection.ReturnValue: - break; - default: - throw ADP.InvalidParameterDirection(value); - } - } } internal static void IsNullOrSqlType(object value, out bool isNull, out bool isSqlType)