Extension Methods I Use A Lot
September 23, 2009
C# extensions have been around for some time and it was a fad for a while to post your favorites. I am following way behind the extension party bus with this post of my favorite extensions. Most of these are poached from Chad and Jeremy and Josh with a few sadly only one of my own mixed in. Below is the Basic Extensions class that is common to a lot of our Dovetail projects. I am not a big believer in class libraries for simple little things like these as extensions that are useful on one project will be useless on another. using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web.Script.Serialization; namespace Dovetail.Commons { public static class BasicExtensions { /// <summary> /// Write string to the console. /// </summary> public static void WriteToConsole(this string stringValue) { Console.WriteLine(stringValue); } ///…