Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4451

[LINQ3] System.Linq.Dynamic.Core.DynamicQueryableExtensions.OrderBy doesn't work in Linq3, but works in Linq2

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Summary

      `System.Linq.Dynamic.Core.DynamicQueryableExtensions.OrderBy` used to work in Linq2, but throws an exception in Linq3

      C# Driver Version: V2.18

      MongoDB Version: 4.4.6 Community

      How to Reproduce

      ```csharp

      //using System.Linq.Dynamic.Core;

      var q = collection.AsQueryable();
      var ordered = (IOrderedMongoQueryable<PocoClass>)q.OrderBy("Name");

      ```

      in V2, this works successfully.

      in V3, `OrderBy` throws an exception:

      ```

      Message: 
      System.NotImplementedException : The method or operation is not implemented.

        Stack Trace: 
      MongoQueryProvider`1.CreateQuery(Expression expression)
      DynamicQueryableExtensions.InternalOrderBy(IQueryable source, ParsingConfig config, String ordering, IComparer comparer, Object[] args)
      DynamicQueryableExtensions.OrderBy(IQueryable source, ParsingConfig config, String ordering, Object[] args)
      DynamicQueryableExtensions.OrderBy[TSource](IQueryable`1 source, ParsingConfig config, String ordering, Object[] args)
      DynamicQueryableExtensions.OrderBy[TSource](IQueryable`1 source, String ordering, Object[] args)

      ```

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            ahmednfwela@bdaya-dev.com Ahmed Fwela
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: