Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Edited Unassigned: Roundtripping DBNull value using Bsonformatter thrown an error [1440]

$
0
0
Value I am roundtripping - DBNull.Value

All Webapi action (POST) does is return the value.

Exception
{"Error writing Null value. BSON must start with an Object or Array. Path ''."}

Stack Trace:
at Newtonsoft.Json.Bson.BsonWriter.AddToken(BsonToken token)
at Newtonsoft.Json.Bson.BsonWriter.AddValue(Object value, BsonType type)
at Newtonsoft.Json.Bson.BsonWriter.WriteNull()
at Newtonsoft.Json.JsonWriter.WriteValue(JsonWriter writer, PrimitiveTypeCode typeCode, Object value)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializePrimitive(JsonWriter writer, Object value, JsonPrimitiveContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeValue(JsonWriter writer, Object value, JsonContract valueContract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.Serialize(JsonWriter jsonWriter, Object value)
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding) in e:\WebApi\aspnetwebstack\src\System.Net.Http.Formatting\Formatting\BaseJsonMediaTypeFormatter.cs:line 436
at System.Net.Http.Formatting.BsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, Encoding effectiveEncoding) in e:\WebApi\aspnetwebstack\src\System.Net.Http.Formatting\Formatting\BsonMediaTypeFormatter.cs:line 221
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content) in e:\WebApi\aspnetwebstack\src\System.Net.Http.Formatting\Formatting\BaseJsonMediaTypeFormatter.cs:line 399
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext) in e:\WebApi\aspnetwebstack\src\System.Net.Http.Formatting\Formatting\BaseJsonMediaTypeFormatter.cs:line 384

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>