¿Por qué falla la asignación nula en operador ternario: no hay conversión implícita entre nulo e int?
Esto falla con unThere is no implicit conversion between 'null' and 'int'
long? myVar = Int64.Parse( myOtherVar) == 0 ? null : Int64.Parse( myOtherVar);
Sin embargo, esto tiene éxito:
if( Int64.Parse( myOtherVar) == 0)
myVar = null;
else
myVar = Int64.Parse( myOtherVar);
¿Hay alguna manera de hacer que el operador ternario tenga éxito?