![]() |
|||
Comments and Discussions
|
About Article
Alternative to Replacing foreach loop with LINQ
For replacing foreach loop, for a non-query operation, just for performing an operation on each element in the collection, we can use the ForEach method, like the following:students.ToList().ForEach(s => { s.Grade += 10;});
Related Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||