private static bool IsSqlParameterCollectionsEqual(SqlParameterCollection expected, SqlParameterCollection actual) { if (expected == actual || (expected == null && actual == null)) { return(true); } if ((expected != null && actual == null) || (expected == null && actual != null) || (expected.Count != actual.Count)) { return(false); } return(expected.SequenceEqual(actual)); }