Skip to content

Commit 0abfa21

Browse files
authored
CSHARP-5438: Add Odata version to client metadata (#1575)
1 parent a701c2e commit 0abfa21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/MongoDB.Driver/Core/Connections/ClientDocumentHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ internal static BsonDocument CreateDriverDocument()
8989
internal static BsonDocument CreateDriverDocument(string driverVersion)
9090
{
9191
var driverName = "mongo-csharp-driver";
92-
if (TryGetType("MongoDB.AspNetCore.OData.MongoEnableQueryAttribute, MongoDB.AspNetCore.OData", out _))
92+
if (TryGetType("MongoDB.AspNetCore.OData.MongoEnableQueryAttribute, MongoDB.AspNetCore.OData", out var queryAttributeType))
9393
{
94+
var odataVersion = GetAssemblyVersion(queryAttributeType.Assembly);
95+
driverVersion = $"{driverVersion}|{odataVersion}";
9496
driverName = $"{driverName}|odata";
9597
}
9698

0 commit comments

Comments
 (0)