When NoTracking is used, empty BSON collections result in null CLR collections.
Previous closed bug which fixed behaviour for tracked queries: https://jira.mongodb.org/browse/EF-105
To reproduce, change the following tests to use NoTracking:
db.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
- OwnedEntity_non_nullable_collection_is_empty_when_empty
- OwnedEntity_nullable_collection_is_empty_when_empty
Â
I believe the following code should also be executed when using NoTracking (entry == null) to fix the issue:
Â