Skip to content

Commit 8472bff

Browse files
authored
EF-26: Pass EF Provider data to Client Meta Data Handshake (#1185)
1 parent 2f81c0e commit 8472bff

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ internal static BsonDocument CreateDriverDocument(string driverVersion)
7777
driverName = $"{driverName}|legacy";
7878
}
7979

80+
if (IsEFLoaded())
81+
{
82+
driverName = $"{driverName}|efcore";
83+
}
84+
8085
return new BsonDocument
8186
{
8287
{ "name", driverName },
@@ -87,6 +92,11 @@ bool IsLegacyLoaded()
8792
{
8893
return Type.GetType("MongoDB.Driver.MongoServer, MongoDB.Driver.Legacy") != null;
8994
}
95+
96+
bool IsEFLoaded()
97+
{
98+
return Type.GetType("MongoDB.EntityFrameworkCore.Query.MongoQueryContext, MongoDB.EntityFrameworkCore") != null;
99+
}
90100
}
91101

92102
internal static BsonDocument CreateEnvDocument()

0 commit comments

Comments
 (0)