-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.8.3
-
Component/s: None
-
None
The current implementations of IConvertible.ToType do not handle conversion to type object. We were not expecting ToType to be called with a conversionType argument of type object (after all you can simply cast to object), but it turns out this is legal so we should support it.
The following code snippet currently throws an InvalidCastException:
var id = ObjectId.GenerateNewId(); var obj = ((IConvertible)id).ToType(typeof(object), null);
- is related to
-
CSHARP-835 Implement TypeConverter for ObjectId
- Closed