Check out example codes for "foreach c# linq example". It will help you in understanding the concepts better.

Code Example 1

sequence.Where(x => x.Name.ToString().Equals("Apple"))
    .ToList()
    .ForEach( x =>
     {
       if(someCondition)
       {
         // Do some stuff here.
       }  
     });

Code Example 2

items.ToList().ForEach(i => i.DoStuff());

Learn ReactJs, React Native from akashmittal.com