Skip to content

Commit dc92da4

Browse files
kosmakoffrstam
authored and
rstam
committed
Return value as it is, if it is already BsonValue or ancestor
1 parent 6be0e77 commit dc92da4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Bson/ObjectModel/BsonTypeMapper.cs

+4
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,10 @@ public static bool TryMapToBsonValue(object value, out BsonValue bsonValue)
443443
return true;
444444
}
445445

446+
bsonValue = value as BsonValue;
447+
if (bsonValue != null)
448+
return true;
449+
446450
var valueType = value.GetType();
447451
if (valueType.IsEnum)
448452
{

0 commit comments

Comments
 (0)