One problem with C# is that if you want to modify a collection, you have to manually iterate over it. The generic List class supports ForEach, but there's no method that allows global list changes. C# is kind of restrictive in what changes you can make while iterating, so Edward wrote a couple of simple extension methods to avoid repeating the same pattern. These methods allow transformations on all values in an IList or IDictionary based on a delegate. Also included is a RandomSet class for testing with random samples. In case it's not obvious, this code only compiles as …

Member Avatar
+0 forum 0

Edward designed this class as a poor man's named property initializer using syntax similar to C99's designated initializers if they worked in a C++ constructor call: [code] Person me( .FirstName="Radical", .LastName="Edward", .Age=23 ); [/code]

Member Avatar
+0 forum 0

The End.