public static bool SequenceEqual(this NameValueCollection first, NameValueCollection second) { return first.AllKeys.SequenceEqual(second.AllKeys) && first.AllKeys.All(key => first.GetValues(key).SequenceEqual(second.GetValues(key))); }