[CSHARP-3922] LINQ3: support calls to constructors in Select Created: 20/Oct/21 Updated: 28/Oct/23 Resolved: 21/Jun/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | LINQ3 |
| Affects Version/s: | None |
| Fix Version/s: | 2.16.1 |
| Type: | Task | Priority: | Unknown |
| Reporter: | Boris Dogadov | Assignee: | Robert Stam |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
Support expressions like:
Note: after investigation I'm modifying the description of this ticket to make it more general to refer to the use of any constructor call in Select statement. The current implementation assumes that any `NewExpression` is the creation of an anonymous type value, but that's not always true. The following test case illustrates a simple case of the more general problem to be solved:
|
| Comments |
| Comment by Githook User [ 21/Jun/22 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Githook User [ 21/Jun/22 ] |
|
Author: {'name': 'rstam', 'email': 'robert@robertstam.org', 'username': 'rstam'}Message: |
| Comment by Robert Stam [ 20/Oct/21 ] |
|
To implement this we will have to know how the class being constructed is serialized. Most likely this will require mapping each constructor argument to the corresponding property so that we can figure out the element names in the computed document. |