[CSHARP-4632] The memberinfo argument must be for class {ChildTestDto}, but was for {ParentTestDto}} Created: 02/May/23 Updated: 28/Oct/23 Resolved: 30/May/23 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.20.0 |
| Type: | Bug | Priority: | Unknown |
| Reporter: | Arne Schoonvliet | Assignee: | Oleksandr Poliakov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | LINQ3, linq3, triage | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||||||
| Description |
| Comments |
| Comment by Githook User [ 30/May/23 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Oleksandr Poliakov', 'email': '31327136+sanych-sun@users.noreply.github.com', 'username': 'sanych-sun'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by James Kovacs [ 03/May/23 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Hi, arne@intigriti.com, We are able to reproduce the reported issue. I will include a simplified repro below. The root cause of the problem is that the driver assumes that constructor arguments match properties defined on the class, not on a base class. We are working on a fix. In the meantime you can work around the issue by continuing to use LINQ2 or switching to property initializer syntax with LINQ3. This would require defining a parameterless constructor for your DTO.
We apologize that the LINQ3 transition has not been a smooth one for you. When implementing LINQ3, we ensured that all existing LINQ2 tests pass as well as writing additional tests for new features. Unfortunately existing tests obviously didn't cover all possible scenarios such as yours. We first introduced LINQ3 in the 2.14 driver over a year ago as an opt-in improvement. We have been resolving reported issues aggressively to remediate problems discovered in LINQ3. We knew that eventually we would have to make LINQ3 the default (rather than opt-in) and this would surface additional LINQ3 issues given the myriad ways that LINQ can be used. That change to make LINQ3 the default provider happened in the 2.19. We should have documented the known changes when moving from LINQ2 to LINQ3. You can follow CSHARP-4618 for this request. The LINQ2 provider will continue to be available in the 2.X driver series. Support for LINQ2 will not be removed until the 3.0.0 driver, which is still awhile away. The team is committed to resolving outstanding issues in LINQ3 for queries that worked in LINQ2. Your feedback is invaluable in reporting real world use cases that are not yet covered by our test suite. I encourage you to report any additional problems that you find during your migration. Sincerely, James
The following test case passes in LINQ2 but fails in LINQ3:
| |||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Service Account: DBX TPM [ 02/May/23 ] | |||||||||||||||||||||||||||||||||||||||||||||||
|
Hi arne@intigriti.com, thank you for reporting this issue! The team will look into it and get back to you soon. |