Is it possible to cast a custom class to a value type?
Here\'s an example:
var x = new Foo(); var y = (int) x; //Does not compile
Is i
I would suggest you implement the IConvertible interface as that is designed to handle this. See http://msdn.microsoft.com/en-us/library/system.iconvertible.aspx