From 6785678eaf75b178c2b83743b9ae250d21a370c5 Mon Sep 17 00:00:00 2001 From: adelinowona Date: Mon, 16 Dec 2024 12:39:43 -0500 Subject: [PATCH] CSHARP-5438: Add Odata version to client metadata --- src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs b/src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs index 8d9c6c60ef3..c4be5c2cf22 100644 --- a/src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs +++ b/src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs @@ -89,8 +89,10 @@ internal static BsonDocument CreateDriverDocument() internal static BsonDocument CreateDriverDocument(string driverVersion) { var driverName = "mongo-csharp-driver"; - if (TryGetType("MongoDB.AspNetCore.OData.MongoEnableQueryAttribute, MongoDB.AspNetCore.OData", out _)) + if (TryGetType("MongoDB.AspNetCore.OData.MongoEnableQueryAttribute, MongoDB.AspNetCore.OData", out var queryAttributeType)) { + var odataVersion = GetAssemblyVersion(queryAttributeType.Assembly); + driverVersion = $"{driverVersion}|{odataVersion}"; driverName = $"{driverName}|odata"; }