Remove duplicate casts from DbMetaDataFactory (dotnet/corefx#40328)
authorStephen Toub <stoub@microsoft.com>
Thu, 15 Aug 2019 03:59:34 +0000 (23:59 -0400)
committerGitHub <noreply@github.com>
Thu, 15 Aug 2019 03:59:34 +0000 (23:59 -0400)
Commit migrated from https://github.com/dotnet/corefx/commit/66273ed9944c7c964d3d51771ed8d4b4ddce3e8c

src/libraries/Common/src/System/Data/ProviderBase/DbMetaDataFactory.cs
src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcMetaDataFactory.cs
src/libraries/System.Data.OleDb/src/System/Data/ProviderBase/DbMetaDataFactory.cs

index 61ea933..bd12a2d 100644 (file)
@@ -171,7 +171,7 @@ namespace System.Data.ProviderBase
                 schemaTable = reader.GetSchemaTable();
                 foreach (DataRow row in schemaTable.Rows)
                 {
-                    resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"] as Type);
+                    resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"]);
                 }
                 object[] values = new object[resultTable.Columns.Count];
                 while (reader.Read())
index 385a375..dd6c41c 100644 (file)
@@ -1106,7 +1106,7 @@ namespace System.Data.Odbc
             DataTable schemaTable = reader.GetSchemaTable();
             foreach (DataRow row in schemaTable.Rows)
             {
-                resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"] as Type);
+                resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"]);
             }
 
             values = new object[resultTable.Columns.Count];
index d2d4a98..e9be236 100644 (file)
@@ -193,7 +193,7 @@ namespace System.Data.ProviderBase
                 schemaTable = reader.GetSchemaTable();
                 foreach (DataRow row in schemaTable.Rows)
                 {
-                    resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"] as Type);
+                    resultTable.Columns.Add(row["ColumnName"] as string, (Type)row["DataType"]);
                 }
                 object[] values = new object[resultTable.Columns.Count];
                 while (reader.Read())