Attached we have a Model.cs with a basic example and a Service class where I centralized all my database connections and functions.
In the Service class I'm trying to get less fields from my collection using "Select" function, supposing that my collection have three fields (as we can see in the Model.cs).
When the code execute the lines between 20-24, we get the following error: "Additional information: Element 'Id' does not match any field or property of class MongoTestClass".
But, if I remove the lines (20-24), we will get everything working fine.
- duplicates
-
CSHARP-1555 Projecting from and to the same type including the _id field causes deserialization to fail
- Closed