Click here to Skip to main content
15,880,854 members

Article Recommendation

Your Name:*
Your Email:*
Your friend's Email:*
The Message text:

Hi!,

This email was created by [MemberName] <[MemberEmail]> who thought you would be interested in the following Article:

"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;});

CodeProject also contains hundreds of articles, free source code samples and applications to help in your day to day programming. Why not give it a try!

 
Note: the details entered on this page will not be stored or used for any purpose other than for sending this email.