[CSHARP-2275] Ignore name on GetCurrentBsonType() Created: 18/May/18 Updated: 25/Feb/19 Resolved: 25/Feb/19 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Serialization |
| Affects Version/s: | 2.6.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Vyacheslav | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
I have been getting an issue with regards to the GetCurrentBsonType() method. My situation for some context: I read a value and then proceed to a custom serializer Doing this results in an exception thrown by
as _state is name. However, if I change my operations to 1) read start document I get another exception when the value to be deserialized is in an array - where there is no name. My proposed solution is to add
before the state check as in the VerifyBsonType() method. |
| Comments |
| Comment by Ian Whalen (Inactive) [ 25/Feb/19 ] |
|
Closing since we haven't heard from the reporter in 3+ weeks. |
| Comment by Jeffrey Yemin [ 29/Jan/19 ] |
|
Hi bliz937, I'm not sure what you mean. Can you post a more complete example that demonstrates clearly what you're trying to do? Regards, |
| Comment by Jeffrey Yemin [ 07/Dec/18 ] |
|
Hi bliz937, I suspect your serializer is not using BsonReader in the way it is intended to be used. The general pattern is:
|
| Comment by Vyacheslav [ 18/May/18 ] |
|
Added a PR |