Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3 from truefit/master

Handles invalid BSON property names in NameValueCollectionSerializer
  • Loading branch information...
commit a246549655d315d240353db8416d4df41d24bad3 2 parents 5e8b9ea + 2fe0de1
@CaptainCodeman authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Elmah.MongoDB/NameValueCollectionSerializer.cs
View
4 src/Elmah.MongoDB/NameValueCollectionSerializer.cs
@@ -30,7 +30,7 @@ IBsonSerializationOptions options
bsonReader.ReadStartDocument();
while (bsonReader.ReadBsonType() != BsonType.EndOfDocument)
{
- var name = bsonReader.ReadName();
+ var name = bsonReader.ReadName().Replace("__period__", ".");
var value = bsonReader.ReadString();
nvc.Add(name, value);
}
@@ -51,7 +51,7 @@ IBsonSerializationOptions options
{
foreach (var key in nvc.AllKeys)
{
- bsonWriter.WriteString(key, nvc[key]);
+ bsonWriter.WriteString(key.Replace(".", "__period__"), nvc[key]);
}
}
bsonWriter.WriteEndDocument();
Please sign in to comment.
Something went wrong with that request. Please try again.