संभावित डुप्लिकेट:
Why can't I set a nullable int to null in a ternary if statement?
Nullable types and the ternary operator. Why won't this work?शून्य से शून्य करने के लिए शून्य के साथ गलत क्या है?
नीचे के साथ क्या गलत
public double? Progress { get; set; }
Progress = null; // works
Progress = 1; // works
Progress = (1 == 2) ? 0.0 : null; // fails
है क्योंकि वहाँ कोई अंतर्निहित सशर्त अभिव्यक्ति का प्रकार निर्धारित नहीं किया जा सकता है के बीच रूपांतरण 'डबल' और '< अशक्त>'
http://stackoverflow.com/questions/2766932/why-cant-i-set-a-nullable-int-to-null-in- dup में
0.0
है ए-टर्नरी-अगर-स्टेटमेंट – pavanred