Because System.Decimal calls the Equals overload, which can take the Decimal value, and your second case calls this method (converting the int parameter to Decimal using an implicit conversion ) and return true.
While in the first case, Nullable tries its best, but can only Object.Equals , which will fail when comparing between a int and a Decimal . If your first call was:
bool result1 = objOrder.PriceNullable.Equals(0M);
You would compare two Decimal s, and now it will return true .
The Nullable Equals Nullable method cannot refer to an implicit conversion from int to Decimal , or when overriding peers that take the Decimal value.
Damien_The_Unbeliever
source share