[CSHARP-2150] RegisterSerializer should check that the serializer's ValueType matches the type it is being registered for Created: 16/Jan/18  Updated: 31/Mar/22

Status: Backlog
Project: C# Driver
Component/s: Serialization
Affects Version/s: 2.5
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Robert Stam Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-1949 BsonSerializer RegisterSerializer sho... Closed
Related
is related to CSHARP-1643 Differencies in how new Driver handle... Closed

 Description   

The following should result in an exception thrown when RegisterSerializer is called:

var intSerializer = new Int32Serializer();
BsonSerializer.RegisterSerializer(typeof(long), intSerializer);

because the types don't agree.


Generated at Wed Feb 07 21:41:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.