Now that the OData and EF Core integration libraries call AppendMetadata directly (ODATA-38, EF-257), the reflection-based auto-detection in ClientDocumentHelper.CreateDriverDocument() is redundant and should be removed.
What to remove
In src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs, delete the two detection blocks from CreateDriverDocument() (lines 94–106):
if (TryGetType("MongoDB.AspNetCore.OData.MongoEnableQueryAttribute, MongoDB.AspNetCore.OData", out var queryAttributeType)) { var odataVersion = GetAssemblyVersion(queryAttributeType.Assembly); driverVersion = $"{driverVersion}|{odataVersion}"; driverName = $"{driverName}|odata"; } if (TryGetType("MongoDB.EntityFrameworkCore.Query.MongoQueryContext, MongoDB.EntityFrameworkCore", out var queryContextType)) { var efVersion = GetAssemblyVersion(queryContextType.Assembly); driverVersion = $"{driverVersion}|{efVersion}"; driverName = $"{driverName}|efcore"; }
Sequencing requirement
This ticket must not ship before ODATA-38 and EF-257 are released. Removing the detection before the integration libraries call AppendMetadata would silently drop OData and EF metadata from the handshake for users who upgrade the driver but not the integration library.