File tree 1 file changed +4
-4
lines changed
src/Microsoft.Data.SqlClient/tests/FunctionalTests
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 5
5
using System ;
6
6
using System . IO ;
7
7
using System . Reflection ;
8
- using System . Runtime . Serialization . Formatters . Binary ;
8
+ using System . Runtime . Serialization ;
9
9
using Xunit ;
10
10
11
11
namespace Microsoft . Data . SqlClient . Tests
@@ -20,16 +20,16 @@ public class SqlErrorTest
20
20
[ Fact ]
21
21
public static void SqlErrorSerializationTest ( )
22
22
{
23
- var formatter = new BinaryFormatter ( ) ;
23
+ DataContractSerializer serializer = new DataContractSerializer ( typeof ( SqlError ) ) ;
24
24
SqlError expected = CreateError ( ) ;
25
25
SqlError actual = null ;
26
26
using ( var stream = new MemoryStream ( ) )
27
27
{
28
28
try
29
29
{
30
- formatter . Serialize ( stream , expected ) ;
30
+ serializer . WriteObject ( stream , expected ) ;
31
31
stream . Position = 0 ;
32
- actual = ( SqlError ) formatter . Deserialize ( stream ) ;
32
+ actual = ( SqlError ) serializer . ReadObject ( stream ) ;
33
33
}
34
34
catch ( Exception ex )
35
35
{
You can’t perform that action at this time.
0 commit comments