[CSHARP-1886] Can't cast Int32 to Int16 Created: 07/Jan/17  Updated: 13/Oct/17  Resolved: 13/Oct/17

Status: Closed
Project: C# Driver
Component/s: Serialization
Affects Version/s: 2.4.1
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Vorobjev Valery Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

.NET core, Windows 10



 Description   

If I have property of my class with type ushort. I get exception: Unable to cast object of type 'System.Int32' to type 'System.UInt16'.

I would like to solve the problem with a type cast. Please use TryParse if necessary.



 Comments   
Comment by Robert Stam [ 11/Jan/17 ]

Can you provide some more information?

At a minimum please provide the line of code that threw an exception and the corresponding stack trace.

With more information we could attempt to reproduce the issue or explain what is happening.

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