[CSHARP-239] Cant' map a class with a member of the same Type. Created: 04/Jun/11 Updated: 02/Apr/15 Resolved: 08/Jun/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.0 |
| Fix Version/s: | 1.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Luigi Bertazzo | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | c#, mapping | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Attachments: |
|
| Description |
|
If a class declare a member of the same class Type you get a mapping error. Possible change in BsonClassMap.cs (all tests passed): /// <summary> } |
| Comments |
| Comment by Robert Stam [ 08/Jun/11 ] |
|
No worries. Thanks for letting us know you got it working. |
| Comment by Luigi Bertazzo [ 07/Jun/11 ] |
|
Not a bug, my fault in mapping the class: i was calling BsonClassMap.LookupClassMap(typeof(A)) inside BsonClassMap.RegisterClassMap<A> while setting some serialization options using IBsonSerializationOptions on the member with the same type A of the class being mapped. Really sorry to waste your time, thanks for your attention. |
| Comment by Robert Stam [ 06/Jun/11 ] |
|
I am unable to reproduce this. See the attached solution (TestSerializeRecursiveClass.zip). Can you provide more information? What does your class look like? What error are you getting? Thanks. |
| Comment by Robert Stam [ 06/Jun/11 ] |
|
Attempt to reproduce. |