Firstly, I canβt make out the functional / lambda aspects of .NET 3.5. I use these functions every day in LINQ, but my problem is understanding the implementation and what they really mean (Lambda? System.Func? Etc, etc.)
With this in mind, the following will be achieved:
As an example, I would like to have an extension method for List (Of T) that sets the properties of all objects in List for a specific value and returns an updated List (Of T). It will be called like this:
VB:
Dim someList As List(Of TextBox) = (New List(Of TextBox)).UpdateExtension(Function(txtb) txtb.Text = "something")
FROM#:
List<TextBox> someList = (new List<TextBox>()).UpdateExtension(txtb => txtb.Text = "something");
What does the extension method look like in VB and C #?
i.e:
<Extension()> _
Public Function UpdateExtension(Of T)(ByVal source As List(Of T), ByVal predicate As ??) As List(Of T)
'??
End Function
Hurrah!
EDIT
, .ForEach(). , , - .ForEach(), .