If you have a collection of objects and you wish to invoke methods in the underlying objects you can use an anonymous delegate inside a lambda expression in the following form:
MyCollection.All((MyObject o)=> { o.MyMethod(); return true; });
This will run MyMethod on all of the objects in your collection.
Posted
6 Oct 2009 2:10 AM
by
Gal Ratner