Remove OData and EF auto-detection from ClientDocumentHelper

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Dotnet Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Adelin Mbida Owona
            Reporter:
            Adelin Mbida Owona
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: