Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
While leaving aside the performance penalties, it is a reasonable approach to make code cleaner.Though you can further benefit from the extension methods:public static void InitDefaults(this object o){ PropertyInfo[] props = o.GetType().GetProperties(BindingFlags.Public |...
7 Jan 2012OriginalGriff 2 alternatives
One of the things missing from C# is the ability to set a default value of auto-implemented properties. You can set a default for variable backed properties, and you can set them for the designer. This does it for you.
Since I've begun my profession as a software developer, I've learned one important fact - change is inevitable. Requirements change, code changes, and life changes.
So..If you're not moving forward, you're moving backwards.