Don’t Repeat Yourself using LINQ & Delegates

May 29, 2009 14:32


Originally published at maloki. You can comment here or there.

In one of my projects, I had to look for certain objects using certain qualifiers: ID, Name, ID & Name, etc… Without optional parameters (Hello C# 4.0!), I ended up with copying & pasting whole blocks of code: initializing, filtering, returning the result, error handling, etc. I wondered if there was an easier solution to that and then it hit me! LINQ & delegates!

Read the rest of this entry »
Previous post Next post
Up