Skip to content

Conversation

@ChuckNovice
Copy link
Owner

Summary

  • Remove all BsonIgnoreIfNull and BsonRepresentation attributes from RecurringThingDocument
  • Add IgnoreIfNullConvention to convention pack for automatic null property handling
  • Register GuidSerializer with BsonType.String for consistent Guid serialization
  • Only [BsonId] attribute remains (required to identify document ID field)

This follows the project convention of configuring conventions once during registration rather than using attributes on every property.

Test plan

  • All 154 unit tests pass
  • Code formatting verified with dotnet format --verify-no-changes
  • Build succeeds with no warnings

🤖 Generated with Claude Code

ChuckNovice and others added 2 commits January 28, 2026 00:28
- Remove BsonIgnoreIfNull and BsonRepresentation attributes from document
- Add IgnoreIfNullConvention to handle null property serialization
- Register GuidSerializer with BsonType.String for Guid representation
- Keep only [BsonId] attribute (required to identify document ID)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The built-in GuidSerializer(BsonType.String) throws
"GuidRepresentation is Unspecified" in newer MongoDB drivers.

This commit:
- Adds StringGuidSerializer that serializes GUIDs as strings
- Adds GuidStringRepresentationConvention to apply it globally
- Adds MongoDbInitializer to ensure conventions register early
- Calls EnsureInitialized from all MongoDB component constructors
- Removes [BsonId] attribute, using NamedIdMemberConvention instead

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@ChuckNovice ChuckNovice merged commit b694593 into main Jan 28, 2026
2 checks passed
@ChuckNovice ChuckNovice deleted the refactor/remove-remaining-bson-attributes branch January 28, 2026 05:45
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