[CSHARP-3425] x => x.ToLower().Equals("firstname") throws NotSupportedException Created: 14/Feb/21  Updated: 28/Oct/23  Resolved: 25/Oct/21

Status: Closed
Project: C# Driver
Component/s: LINQ3
Affects Version/s: 2.11.6
Fix Version/s: 2.14.0

Type: Bug Priority: Major - P3
Reporter: Thierry Habart Assignee: Robert Stam
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hello,

AS-IS :
When i'm trying to execute the following LINQ request x => x.ToLower().Equals("firstname"), the following exception is thrown: toLower is not supported, i'm using the version '2.11.6'.
I need this feature to perform "case insensitive" search.

TO-BE:
I made some modifications in the pull request to support this feature : https://github.com/mongodb/mongo-csharp-driver/pull/440



 Comments   
Comment by Robert Stam [ 25/Oct/21 ]

This issue has been fixed in the new LINQ provider (known as LINQ3) which will be included in the upcoming 2.14 release.

Configure your MongoClientSettings to use LinqProvider.V3 if you want to use this functionality.

To configure a client to use the LINQ3 provider use code like the following

var connectionString = "mongodb://localhost";
var clientSettings = MongoClientSettings.FromConnectionString(connectionString);
clientSettings.LinqProvider = LinqProvider.V3;
var client = new MongoClient(clientSettings);

Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}

Message: CSHARP-3425: Verify that these LINQ queries work in LINQ3.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/84399a18249028181c9ebbdb78a9e161bc91ac70

Comment by James Kovacs [ 17/Feb/21 ]

Hi, Thierry,

Thank you for filing this JIRA ticket and your related PR. We are reviewing your PR and will get back to you shortly with feedback.

Sincerely,
James

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