@@ -73,7 +73,6 @@ public sealed override int MaxDepth
73
73
}
74
74
}
75
75
76
- #if ! NETSTANDARD1_3 // DBNull not supported in netstandard1.3; no need to override there
77
76
/// <inheritdoc />
78
77
public override Task < object > ReadFromStreamAsync ( Type type , Stream readStream , HttpContent content , IFormatterLogger formatterLogger )
79
78
{
@@ -101,7 +100,6 @@ public override Task<object> ReadFromStreamAsync(Type type, Stream readStream, H
101
100
return base . ReadFromStreamAsync ( type , readStream , content , formatterLogger ) ;
102
101
}
103
102
}
104
- #endif
105
103
106
104
/// <inheritdoc />
107
105
public override object ReadFromStream ( Type type , Stream readStream , Encoding effectiveEncoding ,
@@ -234,14 +232,13 @@ public override void WriteToStream(Type type, object value, Stream writeStream,
234
232
235
233
if ( value == null )
236
234
{
237
- // Cannot serialize null at the top level. Json.Net throws Newtonsoft.Json.JsonWriterException : Error
238
- // writing Null value. BSON must start with an Object or Array. Path ''. Fortunately
235
+ // Cannot serialize null at the top level. Json.Net throws Newtonsoft.Json.JsonWriterException : Error
236
+ // writing Null value. BSON must start with an Object or Array. Path ''. Fortunately
239
237
// BaseJsonMediaTypeFormatter.ReadFromStream(Type, Stream, HttpContent, IFormatterLogger) treats zero-
240
238
// length content as null or the default value of a struct.
241
239
return ;
242
240
}
243
241
244
- #if ! NETSTANDARD1_3 // DBNull not supported in netstandard1.3
245
242
if ( value == DBNull . Value )
246
243
{
247
244
// ReadFromStreamAsync() override above converts null to DBNull.Value if given Type is DBNull; normally
@@ -252,7 +249,6 @@ public override void WriteToStream(Type type, object value, Stream writeStream,
252
249
// rather than null, and not meet the receiver's expectations.
253
250
return ;
254
251
}
255
- #endif
256
252
257
253
// See comments in ReadFromStream() above about this special case and the need to include byte[] in it.
258
254
// Using runtime type here because Json.Net will throw during serialization whenever it cannot handle the
0 commit comments