LINQ within a foreach()
An example of how LINQ where clauses save steps.
The where can occur right within the declaration of the foreach
LAMBDA syntax:
Query Syntax:
Both syntaxes compile to the same code
(Credit to @YuvalItzchakov https://stackoverflow.com/a/25412168 )
Comments
Post a Comment