Skip to content

Commit cff7e71

Browse files
sanych-sunCopilot
andcommitted
Update src/MongoDB.Driver/Linq/Linq3Implementation/SerializerFinders/SerializerFinderVisitMember.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9b7314f commit cff7e71

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/MongoDB.Driver/Linq/Linq3Implementation/SerializerFinders/SerializerFinderVisitMember.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected override Expression VisitMember(MemberExpression node)
4646

4747
var resultSerializer = node.Member switch
4848
{
49-
_ when declaringType == typeof(BsonDocument) && !node.Member.IsIndexer() => UnknowableSerializer.Create(node.Type), // we do not support translation of BsonDocument properties other than indexer
49+
_ when typeof(BsonDocument).IsAssignableFrom(declaringType) && !node.Member.IsIndexer() => UnknowableSerializer.Create(node.Type), // we do not support translation of BsonDocument properties other than indexer
5050
_ when declaringType == typeof(BsonValue) => GetBsonValuePropertySerializer(),
5151
_ when IsCollectionCountOrLengthProperty() => GetCollectionCountOrLengthPropertySerializer(),
5252
_ when declaringType == typeof(DateTime) => GetDateTimePropertySerializer(),

0 commit comments

Comments
 (0)