[CSHARP-432] Linq doesn't work with derived types when needs to query by string value field Created: 04/Apr/12 Updated: 02/Apr/15 Resolved: 04/Apr/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.4 |
| Fix Version/s: | 1.4.1 |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Brian | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Got abstract BaseClass and DerivedClass in "collection1"
Query:
Exception: NullReferenceException "Object reference not set to an instance of an object" |
| Comments |
| Comment by Robert Stam [ 04/Apr/12 ] |
|
Thanks for taking another look. I'll go ahead and mark this as resolved then. This is fixed in the master branch in github so if you're willing to work with the very latest you will see it fixed. |
| Comment by Brian [ 04/Apr/12 ] |
|
Yep, now I see that this is the same bug - driver doesn't handle base class properties in derived classes. |
| Comment by Robert Stam [ 04/Apr/12 ] |
|
I don't get a NullReferenceException running your program with the latest version of the driver (master in github). The only query you comment as failing is the last. But that query is using the DerivedClass as the type argument to AsQueryable and then querying on an inherited property (x.Id). That's precisely what This is still looking like a duplicate to me. Let me know what you think. Thanks. |
| Comment by Robert Stam [ 04/Apr/12 ] |
|
Thanks. I'll download your program and try it. |
| Comment by Brian [ 04/Apr/12 ] |
|
Done |
| Comment by Robert Stam [ 04/Apr/12 ] |
|
OK. Can you provide the class declarations you used in this test? I'll work on reproducing then. Thanks. |
| Comment by Brian [ 04/Apr/12 ] |
|
Not the same: there query via interger field - and it's work properly (s4 in my tests). They are "attached" bugs |
| Comment by Robert Stam [ 04/Apr/12 ] |
|
Is this a duplicate of |