[CSHARP-1885] Don't cast nullable types (int?, sbyte?, uint? ..) Created: 06/Jan/17 Updated: 07/Mar/17 Resolved: 07/Mar/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Vorobjev Valery | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | Bug, cast, driver, nullable, query | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 10 (stable), mongodb 3.4, driver 2.4.1, .NET core |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
If class contains nullable property (example sbyte?) the query does not work!!! For Example: I have class with property unit.room_count (sbyte?). The final query should look as follows ...unit.room_count: {...}but query look as room_count: {..}. In attache contains the correct version of the query. Bug1.png then room_count as sbyte?. Success.png then room_count as sbyte. |
| Comments |
| Comment by Robert Stam [ 07/Mar/17 ] | ||||||||||||||||||||||||||||||||||
|
Since the issue reported by moc777 was separately resolved in | ||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 13/Feb/17 ] | ||||||||||||||||||||||||||||||||||
|
moc777 Note also that the behavior is better but not yet completely correct in 2.4.2. | ||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 13/Feb/17 ] | ||||||||||||||||||||||||||||||||||
|
moc777 Thanks for the repro info. I'm not sure that your scenario is the same as that of the original submitter (his scenario involved the field name not being correct). I've created a new JIRA ticket to describe your scenario: https://jira.mongodb.org/browse/CSHARP-1919 I've simplified the scenario down to what I believe is the essence of the problem. | ||||||||||||||||||||||||||||||||||
| Comment by Matthew O'Connell [ 13/Feb/17 ] | ||||||||||||||||||||||||||||||||||
|
I can confirm this bug. Here's our example:
| ||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 07/Feb/17 ] | ||||||||||||||||||||||||||||||||||
|
There is not enough information here to attempt to reproduce this. Can you please provide additional information? Primarily what is needed are the types and values of all the variables and the class definitions. Thanks. |