C#/.NET Little Wonders: The Generic Action Delegates

added by BlackRabbitCoder
11/4/2011 8:45:05 AM

579 Views

Back in one of my three original “Little Wonders” Trilogy of posts, I had listed generic delegates as one of the Little Wonders of .NET. Later, someone posted a comment saying said that they would love more detail on the generic delegates and their uses, since my original entry just scratched the surface on them. So over the next few weeks, I’ll be looking at some of the handy generic delegates built into .NET. For this week, I’ll give a quick overview of delegates and their usefulness. Then I’ll launch into a look at the Action generic delegates and how they can be used to support more generic, reusable algorithms and classes.


2 comments

dpeterson
11/4/2011 8:46:51 AM
I'm actually a little upset at myself for never taking advantage of this...I'll need to remedy that for the future.

Noldorin
11/4/2011 7:59:33 PM
Heh, I'm surprised. This is a constant feature in my code ever since lambda expressions/generic Func objects came into .NET. :-) I guess you don't really lose anything except type safety though...