What are your favorite extension methods for C#? (codeplex.com/extensionoverflow)

public static bool In<T>(this T source, params T[] list) { if(null==source) throw new ArgumentNullException(“source”); return list.Contains(source); } Allows me to replace: if(reallyLongIntegerVariableName == 1 || reallyLongIntegerVariableName == 6 || reallyLongIntegerVariableName == 9 || reallyLongIntegerVariableName == 11) { // do something…. } and if(reallyLongStringVariableName == “string1” || reallyLongStringVariableName == “string2” || reallyLongStringVariableName == “string3”) { // … Read more

tech