public static void NotNullOrEmpty(string str, string paramName) { if (String.IsNullOrEmpty(str)) throw new ArgumentException("Value is required.", paramName); }