Z
zdbdam
Guest
I tried to use following code to get "System.Decimal" but I received this undesirable exception! ![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
decimal? x = null;
Console.WriteLine(x.GetType()); //I will get an NullReferenceException.
maybe one solution is:
decimal? x = null;
Console.WriteLine(x.GetValueOrDefault().GetType())
but i presume there is a better way.
Continue reading...
![Frown :( :(](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f641.png)
decimal? x = null;
Console.WriteLine(x.GetType()); //I will get an NullReferenceException.
maybe one solution is:
decimal? x = null;
Console.WriteLine(x.GetValueOrDefault().GetType())
but i presume there is a better way.
Continue reading...