Skip to content

Conversation

@rstam
Copy link
Contributor

@rstam rstam commented Nov 22, 2025

This is a prototype of how we might be able to support using a public read-only property of a POCO as the discriminator.

The key is to configure which property (if any) of the POCO to use as the discriminator. That's what the new [BsonDiscriminatorMember] attribute and SetDiscriminatorMember method are about.

The rest of the changes are some relatively small changes to account for the fact that the differences between a hidden _t field and a public POCO member.

@rstam rstam requested review from BorisDog and papafe November 22, 2025 00:45
@rstam rstam requested a review from a team as a code owner November 22, 2025 00:45
Copy link
Contributor

@papafe papafe left a comment

Choose a reason for hiding this comment

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

I think the prototype looks good, and it would unlock some new possibilities for developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants