I\'m working on a project where i find i\'m checking for the following in many, many places:
if(item.Rate == 0 || item.Rate == null) { }
mo
Although I quite like the accepted answer, I think that, for completeness, this option should be mentioned as well:
if (item.Rate.GetValueOrDefault() == 0) { }
This solution
((item.Rate ?? 0) == 0)
(this might be a matter of taste, though).¹ This should not influence your decision, though, since these kinds of micro-optimization are unlikely to make any difference.