Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make HasItems in Extensions Consistent #52

Open
RealDotNetDave opened this issue Aug 27, 2021 · 0 comments
Open

Make HasItems in Extensions Consistent #52

RealDotNetDave opened this issue Aug 27, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@RealDotNetDave
Copy link
Owner

RealDotNetDave commented Aug 27, 2021

Ensure that the collection Extensions classes have consistent HasItems methods. They should be like this:

[MethodImpl(MethodImplOptions.NoInlining)]

public static bool HasItems<T>([NotNull] this List<T> list, [NotNull] Predicate<T> action)
{
	return list.TrueForAll(action);
}
		
		
public static bool HasItems([NotNull] this IEnumerable list) => list.Count() > 0;
		
public static bool HasItems([NotNull] this IEnumerable list, int count) => list.Count() == count;

Add to:

1. ArrayExtensions *+
2. CollectionExtensions *+
3. DictionaryExtensions *+
4. EnumerableExtensions *+
5. ImmutableArrayExtensions *+
6. ObservableCollectionExtensions *+
7. ReadOnlyCollectionExtensions *+
8. SortedDictionaryExtensions *+
9. SortedSetExtensions *+

@RealDotNetDave RealDotNetDave added the enhancement New feature or request label Aug 27, 2021
@RealDotNetDave RealDotNetDave self-assigned this Aug 27, 2021
@RealDotNetDave RealDotNetDave added this to the 5th Release milestone Sep 8, 2021
@RealDotNetDave RealDotNetDave changed the title Make HasItems in Extensions Consistant Make HasItems in Extensions Consistent Jun 15, 2022
RealDotNetDave added a commit that referenced this issue Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant