views:

50

answers:

4

This is the scenario: I have a huge code-base written in .NET 2.0...and sometime back the migration happened to .NET 3.5.

This code-base is both refactored and enhanced as an ongoing maintenance project. I am looking for patterns to identify in code base which are good candidates for LINQ to Objects.

I need pointers for comprehensive analysis in identifying LINQ-to-Object-phillic areas of my code.

+1  A: 

Loops are the first candidates to be replace by Linq2Objects.

Dmytrii Nagirniak
+1 loops in general are the easiest targets
jarrett
A: 

Foreach loops, generally with ifs inside, would be a more specific place I'd pick to start with.

Donblas
+2  A: 

Operations on collections (searching, sorting, filtering, transforming) etc. is the best place to look for places to utilize LINQ. Look for loops that operate imperatively on collections.

Jason
+2  A: 

ReSharper 5 (not released yet) has an "Upgrade to LINQ" feature in its code analysis that's pretty amazing (several coworkers have early access versions installed).

EDIT: Here's a screen shot of the feature in action from the site.

TrueWill