Skip to content

CSHARP-3435: FilterDefinition Inject method should use root serializer #1686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025

Conversation

rstam
Copy link
Contributor

@rstam rstam commented May 6, 2025

No description provided.

@rstam rstam requested review from sanych-sun and adelinowona May 6, 2025 19:01
@rstam rstam requested a review from a team as a code owner May 6, 2025 19:01
@rstam rstam added the bug label May 6, 2025
@rstam rstam removed the request for review from a team May 6, 2025 19:01
Copy link
Contributor

@adelinowona adelinowona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but I left a simple comment

if (filterDefinitionDocumentType != documentSerializer.ValueType)
{
throw new ExpressionNotSupportedException(expression, because: $"FilterDefinition TDocument type: {filterDefinitionDocumentType} does not match document type {documentSerializer.ValueType} ");
}
var serializerRegistry = BsonSerializer.SerializerRegistry;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to store a var for serializerRegistry, we could just have BsonSerializer.SerializerRegistry directly where it is used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to decouple as much as possible the SOURCE of the registry from the USE of it.

Intermediate variables are usually a good thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair

Copy link
Member

@sanych-sun sanych-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rstam rstam merged commit fcbc397 into mongodb:main May 22, 2025
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants