Replaced hardcoded value (2) with TypeCode.DBNull (dotnet/corefx#34707)
authorLiran Chen <1437075+liranc@users.noreply.github.com>
Mon, 21 Jan 2019 00:35:24 +0000 (02:35 +0200)
committerStephen Toub <stoub@microsoft.com>
Mon, 21 Jan 2019 00:35:24 +0000 (19:35 -0500)
Commit migrated from https://github.com/dotnet/corefx/commit/34fd5242fc32e691e33e02b435b7a9b6cb01a2af

src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/Converter.cs

index ca76aa8..d3dcad0 100644 (file)
@@ -356,7 +356,7 @@ namespace System.Runtime.Serialization.Formatters.Binary
             var codeATemp = new InternalPrimitiveTypeE[19];
             codeATemp[(int)TypeCode.Empty] = InternalPrimitiveTypeE.Invalid;
             codeATemp[(int)TypeCode.Object] = InternalPrimitiveTypeE.Invalid;
-            codeATemp[2] = InternalPrimitiveTypeE.Invalid; // TODO: Change 2 to (int)TypeCode.DBNull when it's available
+            codeATemp[(int)TypeCode.DBNull] = InternalPrimitiveTypeE.Invalid;
             codeATemp[(int)TypeCode.Boolean] = InternalPrimitiveTypeE.Boolean;
             codeATemp[(int)TypeCode.Char] = InternalPrimitiveTypeE.Char;
             codeATemp[(int)TypeCode.SByte] = InternalPrimitiveTypeE.SByte;