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
You need to define explicit or implicit casting:
public class Foo { public static implicit operator int(Foo d) { return d.SomeIntProperty; } // ...