Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Main()
- {
- List<Demo1> demo1 = new List<Demo1> { new Demo1 { PropertyToSet = "Start" } };
- List<Demo2> demo2 = new List<Demo2> { new Demo2 { PropertyToSet = "Start" } };
- demo1.ToList().ForEach(c => c.PropertyToSet = "End");
- demo2.ToList().ForEach(c => c.PropertyToSet = "End");
- Console.WriteLine(demo1.First().PropertyToSet); //End
- Console.WriteLine(demo2.First().PropertyToSet); //Start
- }
- public class Demo1 {public string PropertyToSet;}
- public struct Demo2 {public string PropertyToSet;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement