ToLambda Refactor From ReSharper is Just Too Cool!

Can hardly contain my excitement.  I was just cleaning up a business object to post in my MVC article and of course was using JetBrain’s Resharper 4.1.  Not sure if any of you remember, but when I started learning ASP.NET I developed some nice business objects to use with my MSDN articles.  One of the nice tricks used is using anonymous delegates to sort lists.  The code was a little tricky, but id did the job.  Here is the old code:

 


So, the first thing I did was to execute the ReSharper "cleanup" from the right mouse button as follows:

image

Then, when I hover over the "return" and press the right mouse button with the light bulb, I get this:

image

I say "Convert to Lambda" and I get this:

 

 

About Peter Kellner

Peter is a software professional specializing in mobile and web technologies. He has also been a Microsoft MVP for the past 7 years. To read more about Peter Kellner and his experience click here. For information about how Peter Kellner might be able to help you with your project click here.

Follow me:


Comments

  1. Just like magic!

Follow

Get every new post delivered to your Inbox

Join other followers: