public override object Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
{
var bsonType = bsonReader.GetCurrentBsonType();
if (bsonType == BsonType.Null)
{
bsonReader.ReadNull();
return null;
}
var serializer = new StringSerializer();
var nvc = new NameValueCollection();
bsonReader.ReadStartArray();
while (bsonReader.ReadBsonType() != BsonType.EndOfDocument)
{
bsonReader.ReadStartArray();
var key = (string) serializer.Deserialize(bsonReader, typeof (string), options);
var val = (string) serializer.Deserialize(bsonReader, typeof (string), options);
bsonReader.ReadEndArray();
nvc.Add(key, val);
}
bsonReader.ReadEndArray();
return nvc;
}