Enumerable member Foreach

37 views
Skip to first unread message

bartjek

unread,
Sep 27, 2008, 8:33:06 AM9/27/08
to LINQBridge
Hi,
I was wondering why you have decided to implement the extension method
ForEach in class Enumerable in the LinqBridge library.
I was under the impression that one of the main purposes of LinqBridge
was to be able to use Linq to objects in .net prior 3.5, with the
reassurance that if the project would to be recompiled at a later
stage to use the 3.5 framework (for example to be able to extent the
project to start using linq to sql), the only thing needed would be to
remove the reference to this dll, and all would compile as before.

Unfortunately as ForEach is not implemented in .net 3.5, I find myself
having to put ToList() before it, to make things compile again.

In itself no biggie, but was just curious about the reason why this
was decided.

With regards,
Bart

p.s. Thanks for writing such a great informative book, together with
Jeffrey Richer's "clr via c#" it forms my basis in the world of
managed code development.

Joe Albahari

unread,
Sep 27, 2008, 8:43:57 AM9/27/08
to LINQBridge
Hi Bart

Another solution is to move the code for the ForEach method into your
own library, so you can use it with Framework 3.5 as well.

Cheers

Joe
Reply all
Reply to author
Forward
0 new messages