[CSHARP-752] Inconsistent function\boolean handling in Linq queries Created: 06/Jun/13  Updated: 02/Apr/15  Resolved: 27/Aug/13

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

Type: Bug Priority: Major - P3
Reporter: Pete Smith Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, C#, .Net 4.5, Visual Studio 2012



 Description   

It seems like although the QueryTranslator works as intended, there is a problem with the Serialization Info finder when trying to process the following:

strongResult = strongCollection.Where(o => o.Name.StartsWith("Sat") == true).ToList();

If we omit the == true part, then the query works:

strongResult = strongCollection.Where(o => o.Name.StartsWith("Sat")).ToList();

Integration tests reproducing the problem can be found here:

https://github.com/Roysvork/MongoDbStartsWithBugTest

You must have an instance of MongoDb running on localhost with the default port for the tests to run, of course this can be changed easily



 Comments   
Comment by auto [ 27/Aug/13 ]

Author:

{u'username': u'Roysvork', u'name': u'Pete Smith', u'email': u'roysvork@gmail.com'}

Message: CSHARP-752: Method calls that evaluate to booleans can now be the subject of comparison queries in Linq.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/0d346339d12fafd2faa9c0c87ca2bacc0ba44c55

Comment by Sridhar Nanjundeswaran [ 01/Jul/13 ]

Reducing priority to Major since there is a simple workaround as illustrated in the description

Comment by Craig Wilson [ 12/Jun/13 ]

Thanks for the report. We'll take a look.

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