为什么这个显式转换会抛出Specified cast is not valid.异常?
Specified cast is not valid.
decimal d = 10m; object o = d; int x = (int)o;
但这有效:
int x = (int)(decimal)o;
c# casting
c# ×1
casting ×1