[CSHARP-1606] Error using Select function Created: 17/Mar/16 Updated: 05/Apr/19 Resolved: 05/Apr/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Eddy Nakamura | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | question | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Development environment: Windows 10, Visual Studio 2013 Update 5 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
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. |
| Comments |
| Comment by Eddy Nakamura [ 25/Mar/16 ] |
|
Hi Craig, just attached a full project which can insert, but, when i Select the Id field, i get the error I told. Can you try? Thanks. |
| Comment by Craig Wilson [ 24/Mar/16 ] |
|
Hi Eddy, I've attempted to reproduce this but failed. Would you mind providing a minimal console application (program.cs) that I can just run to see this fail? Craig |