[CSHARP-2878] Aggregate Project with object and Id Created: 17/Dec/19 Updated: 28/Oct/23 Resolved: 15/Feb/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq, Serialization |
| Affects Version/s: | 2.10.0 |
| Fix Version/s: | 2.14.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Klaus Prünster | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDb on Cent Os 8 with C# 8 .net core 3.0 |
||
| Epic Link: | CSHARP-3615 |
| Description |
|
Aggregation with Project and anonymous type works
Aggregation with Project and strongly typed class does not work
Exception: System.FormatException: 'Element 'Id' does not match any field or property of class QueryTester.CustomerArticles.'
But I found a workaround:
|
| Comments |
| Comment by Klaus Prünster [ 15/Feb/22 ] | ||||
|
Thats awesome. Thanks for the update! | ||||
| Comment by James Kovacs [ 15/Feb/22 ] | ||||
|
This issue has been fixed in the new LINQ provider (known as LINQ3), which is included in the 2.14 release. Configure your MongoClientSettings to use LinqProvider.V3 if you want to use this functionality. To configure a client to use the LINQ3 provider use code like the following
| ||||
| Comment by Robert Stam [ 25/Mar/20 ] | ||||
|
I can reproduce this, but I don't have a fix for it at this time. | ||||
| Comment by Klaus Prünster [ 17/Dec/19 ] | ||||
|
Sorry for the badly written issue, i committed it by accident and I cannot modify it... Here is my model class structure:
|