[CSHARP-958] Insert is not properly assigning the _id values when the nominal type is an interface Created: 21/Apr/14 Updated: 02/Apr/16 Resolved: 21/Apr/14 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 1.9 |
| Fix Version/s: | 1.9.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Roman Bäriswyl [X] | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows 8.1 |
||
| Description |
|
When using Interfaces for class-definitions for documents and then using collection.Insert with this interface, ObjectId elements are always ObjectId.Empty. This does work correctly with version 1.8.3 and now broke with 1.9.0. Here is a very simple sample with the Person class which implements the IPerson interface. When using the IPerson interface in collection.Insert, the Id is always ObjectId.Empty, when casting the newPerson variable back to Person before inserting, it works correctly. When using c#-driver 1.8.3 (maybe also lower ones), it works with IPerson or casting to Person.
|
| Comments |
| Comment by Githook User [ 23/Apr/14 ] |
|
Author: {u'name': u'rstam', u'email': u'robert@10gen.com'}Message: |
| Comment by Githook User [ 21/Apr/14 ] |
|
Author: {u'name': u'rstam', u'email': u'robert@10gen.com'}Message: |
| Comment by Robert Stam [ 21/Apr/14 ] |
|
Thanks for the report. I am able to reproduce it and am looking into it. |