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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -