int? x = string.IsNullOrEmpty(cert) ? (int?)null : int.Parse(cert);
Mehrdad Afshari
2009-08-14 17:18:52
int? x = string.IsNullOrEmpty(cert) ? (int?)null : int.Parse(cert);
I've come across the same thing ... I usually just cast the null to (int?)
int? x = (string.IsNullOrEmpty(cert)) ? (int?)null: int.Parse(cert);