/// <summary> /// Converts the BsonDocument to a Hashtable. /// </summary> /// <returns>A hashtable.</returns> public Hashtable ToHashtable() { var options = new BsonTypeMapperOptions { DuplicateNameHandling = DuplicateNameHandling.ThrowException, MapBsonArrayTo = typeof(object[]), // TODO: should this be ArrayList? MapBsonDocumentTo = typeof(Hashtable), MapOldBinaryToByteArray = false }; return((Hashtable)BsonTypeMapper.MapToDotNetValue(this, options)); }
/// <summary> /// Converts the BsonDocument to a Dictionary<string, object>. /// </summary> /// <returns>A dictionary.</returns> public Dictionary <string, object> ToDictionary() { var options = new BsonTypeMapperOptions { DuplicateNameHandling = DuplicateNameHandling.ThrowException, MapBsonArrayTo = typeof(object[]), // TODO: should this be List<object>? MapBsonDocumentTo = typeof(Dictionary <string, object>), MapOldBinaryToByteArray = false }; return((Dictionary <string, object>)BsonTypeMapper.MapToDotNetValue(this, options)); }