So, you want to add a couple extra parameters to an existing method in Visual Studio, while not having to change all your existing code to call the new method signature? It’s easy with CodeRush from Devexpress. In this post, I’ll start with a simple method and add some parameters to it, then do the magic refactor.
Here is the starting code.
public static int SynchronizeScopesAsyncStart( int dbSyncPairId, string schemaName, string connectionStringLeft, string scopeLeft, string connectionStringRight, string scopeRight, bool skipDbLogging) {...
(more…)
For the last few days, I’ve been using DevExpress CodeRush and am finding some very useful refactorings. Many I’m not blogging about, but there are a few that I really like. In this post, I’m going to show just two of those refactorings that have been making my code much nicer and easier to write. One is the “Introduce Using” refactoring, and the other is “Convert to Lambda Expression”.
Before I go into the details, I’d just like to disclose that when I was first writing the Silicon Valley Code Camp web site, I was an asp.net and c# newby. I’m not claiming wizard status now, but I have to admit that when I go back and look at some of the code I wrote back then (including what I’m showing below before the refactoring), it’s a little embarrassing. Silicon Valley Code Camp for me as “when I’m not doing real work” web site so I don’t really have the time to go back and clean things up. Now, with CodeRush, it’s easy to clean things up when I see them with very little effort.
(more…)