List.ForEach in vb.net – perplexing me
It’s because you used Function instead of Sub. Since a Function returns a value, the compiler considers that the equals sign (=) is used as a comparison, not an assignment. If you change Function to Sub, the compiler would correctly consider the equals sign as an assignment: TempList.ForEach(Sub(obj) obj.Deleted = True) If you had a …