Skip to content

feat: Implement EntityKeyConvention for mapping entity keys to _id in MongoDB and remove experimental flag - #17

Merged
gmasci-ca merged 4 commits into
mainfrom
fixes
Oct 20, 2026
Merged

gmasci-ca merged 4 commits into
mainfrom
fixes

Conversation

@adamelio-ca

Copy link
Copy Markdown
Contributor

Description

Promotes the MongoDB packages to stable and fixes the issues found while reviewing them.

Stabilization

  • Removed [Experimental] from Data.MongoDB, Data.MongoDB.DependencyInjection and Data.MongoDB.Mapster: their public API no longer raises CAEP000 and follows SemVer.

Fixes

  • Transaction probe: a mongod started with --replSet but not yet initiated is no longer cached as standalone, and a failed handshake is not cached either.
  • <TypeName>Id keys: they are now stored in _id. Before, Find returned null and Update/Remove threw.
  • UseClient(client): a client passed in is no longer disposed together with the service provider.
  • Existing Guid serializer: AddData no longer fails when the application has already registered one. A mismatching binary representation fails with a clear message.
  • Seeding with several instances: concurrent instances no longer duplicate the seed data. A per-collection marker in __caep_seeding, written in the seed transaction, makes concurrent seeds conflict (requires transactions).
  • Async path: FindAsync/SaveAsync no longer block a thread to start the session or detect the topology. An ExecuteAsync operation committed by a synchronous Save runs on the thread pool.
  • Assembly scanning: AddEntitiesFrom/AddSeedsFrom skip types that cannot be loaded instead of failing.

Documentation

  • ExecuteAsync operations may be retried inside a transaction and must have no side effects outside the session.
  • The session of a scope is not thread-safe.
  • The provider's conventions apply process-wide.
  • dataaccesslayer.md now lists MongoDB among the providers.

Related issues

None.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other (MongoDB packages promoted from experimental to stable)

Checklist

  • I have read the CONTRIBUTING guidelines
  • The build passes (dotnet build --configuration Release)
  • Tests pass (dotnet test --configuration Release)
  • I have added/updated tests where relevant
  • I have updated the documentation where relevant

@gmasci-ca
gmasci-ca merged commit 9da0121 into main Oct 20, 2026
3 checks passed
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