In the old days, we’d write something like this:
view.Rows.Add("Type");
view.Rows.Add("Count");
view.Rows.Add("Whatever");
With C# 3.0 we can do this:
new string[] { "Type", "Count", "Whatever" }
.ForEach(str => view.Rows.Add(str));
That is very cool syntatic sugar. Sure, this is not new news, but when you think about C# in the context of the new features available in 3.0, it really starts to feel a lot more like coding with JavaScript (which is a good thing).
Leave a comment