1/24/2018 - 4:26 AM

Update List<T> without loop

Update List without loop

As the Q of LINQ says, the basic usage of LINQ is to query, not to update.

The less verbose form of foreach is the ForEach method of List<T>:

li.ForEach(z => z.MarksExamTotalOverAll = 50);

List<Myclass> li = new List<Myclass>();
 Parallel.ForEach(li, l => l.MarksExamOutOfMarksTotalOverAll = 50);