Browse files

Merge pull request #3 from truefit/master

Handles invalid BSON property names in NameValueCollectionSerializer
  • Loading branch information...
2 parents 5e8b9ea + 2fe0de1 commit a246549655d315d240353db8416d4df41d24bad3 @CaptainCodeman committed Oct 31, 2011
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();

0 comments on commit a246549

Please sign in to comment.