[CSHARP-140] Hide hierarchy discriminator in query when anonymous type is used for wrapping. Created: 22/Dec/10 Updated: 02/Apr/15 Resolved: 27/Dec/10 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 0.9 |
| Fix Version/s: | 1.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Timofei Mironov | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
MongoDB v 1.6.3 |
||
| Description |
|
Here is sample code firstly: db.GetCollection<A>("A").Insert(a); var o1 = db.GetCollection<A>("A").FindOneAs<A>(Query.Wrap(new { c = "asd2" }));object selector = new { c = "asd2" } ; Assert.IsNotNull(o1); // Success The problem is when I want to use anonymous type instance as a selector for wrapping query. BsonClassMapSerialzier.Serialize(..) line 175. } I think it would be better if no descriminator applied when using anonymous instance as a subject for wrapping. |
| Comments |
| Comment by Robert Stam [ 27/Dec/10 ] |
|
We now never serialize a discriminator for anonymous classes or wrapped objects (with the exception of Update.Replace). |