C# 3.0 Automatic Properties

March 12th, 2009 Comments

OK, so better later than never! Somehow I missed the automatic properties feature of C# 3.0, and just discovered it while I was reading up on something unrelated. It’s a nice feature of C# 3.0 that saves you a few key strokes hence enhances developer productivity as well as allows for more clear and concise code.

Using this new feature, instead of defining private variables and creating explicit getters and setters, you can create properties like this:

public class Employee
{
   public string ID { get; set; }
   public string LastName { get; set; }
   public string FirstName { get; set; }
}

Free Visual Studio 2008 Productivity Add-in

March 11th, 2009 Comments

Developer Express and Microsoft provide a new version of CodeRush licensed exclusively for C# developers working in Visual Studio. The new product is called CodeRush Xpress, and it includes a slew of useful features to boost your productivity under Visual Studio.

You can download CodeRush Xpress here.

The Castle Project

August 17th, 2007 Comments
Castle Project

In the last couple of years I have noticed a steadily growing interest in the .NET community around the Inversion of Control (IoC) and Dependency Injection (DI) patterns.  This is partly due to the fact that a number of excellent frameworks have emerged and gained popularity that allow us to use these designs in our applications relatively painlessly.  One such framework is the open source Castle Project.  In my opinion Castle is the best implementation of IoC and DI among many others that I have come across including Spring.NET, NInject, and ObjectBuilder.  This is however my opinion; which framework you use largely depends upon your requirements and your preferences.

If you are just getting started with Castle or are curious about why the heck one should use IoC and DI, I strongly suggest you check out the 3-part article series by Simone Busoli.  I just came across these articles and I can’t stress enough how well they are written.

SQL Server Database Comparison and Synchronization

April 18th, 2007 Comments
SQL Server

Since database are usually designed in development environments, migrating changes over to other environments (e.g. QA and production) is not a trivial task.  This is because SQL Server does not have any built-in tools to compare database schemas. 

There are quite a few third-party tools that would make your life easier, most notably, Red Gate’s SQL Compare (reasonably priced around $300).

At times, buying a commercial tool is not really an option, so one must resort to googling for free tools.  There are three such tools that I am aware of:

  1. SQLDBDiff by SQLDBTools
    A very decent tool that comes in both freeware and shareware versions.  Freeware version is not badly crippled; only advanced features such as multi-database comparison, data content comparison, etc. are disabled.

  2. Database Schema Comparison Utility
    This is a Code Project article that comes with C# source code of a schema comparison utility.  The utility itself is pretty bare-bone, but gets the job done.
  3. StarInix Free Database Compare 2.0
    I have not used this tool, but from the advertised feature list, it looks pretty good.  Most notably, in addition to SQL Server, this tool works with Access and MySQL databases.