c# - foreach vs LINQ .ForEach() -
c# - foreach vs LINQ .ForEach() -
this question has reply here:
why foreach method on list<t> collection? [duplicate] 4 answerswhy linq .foreach require list object, while foreach statement requires ienumerable?
i prefer using foreach when having multiple lines , linq single line statements - readability.
but preferred, , why? , why difference?
there no linq foreach() method. method looking @ a fellow member of list<t>.
see here give-and-take on why linq/ienumerable doesn't have foreach().
c# linq foreach
Comments
Post a Comment