C# linq FirstOrDefault() -


i select 1 double value ienumerable, how can overload firstordefault() function, return null on default, instead of zero, iwant like:

double? x = ... .firstordefault(); 

i can catch exception, , write double? x = null, have 20 variables, , not way

why not do:

double? x = mydoubles.cast<double?>().firstordefault(); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -