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
Another possibility is to write a Parse and TryParse extension method for your class.
You'd then write your code as follows:
var x = new Foo(); var y = int.Parse(x);