[CSHARP-4451] [LINQ3] System.Linq.Dynamic.Core.DynamicQueryableExtensions.OrderBy doesn't work in Linq3, but works in Linq2 Created: 14/Dec/22  Updated: 27/Oct/23  Resolved: 30/Dec/22

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Ahmed Fwela Assignee: Robert Stam
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CSHARP-4376 Add LINQ3 support for untyped CreateQ... Closed

 Description   

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)

```



 Comments   
Comment by PM Bot [ 30/Dec/22 ]

There hasn't been any recent activity on this ticket, so we're resolving it. Thanks for reaching out! Please feel free to comment on this if you're able to provide more information.

Comment by Robert Stam [ 15/Dec/22 ]

Nuget is the only way we distribute our releases.

Sorry, I mistakenly pointed you to version 2.18.1, which has not yet been released. 

Comment by Ahmed Fwela [ 14/Dec/22 ]

 Is there a way to depend on 2.18.1 outside of nuget ?

Comment by Robert Stam [ 14/Dec/22 ]

Thank you for reporting this.

This appears to a manifestation of the issue reported in CSHARP-4376, which was fixed in version 2.18.1.

Could you test with version 2.18.1 and let us know if there are still issues?

Generated at Wed Feb 07 21:48:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.