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

Prototype collection IfAny() #25

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amantinband
Copy link
Owner

No description provided.

@codecov-commenter
Copy link

Codecov Report

Merging #25 (4387d35) into main (cf9adce) will decrease coverage by 2.26%.
The diff coverage is 5.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #25      +/-   ##
==========================================
- Coverage   93.74%   91.48%   -2.27%     
==========================================
  Files          28       29       +1     
  Lines         735      810      +75     
==========================================
+ Hits          689      741      +52     
- Misses         46       69      +23     
Impacted Files Coverage Δ
src/Program.cs 0.00% <0.00%> (ø)
...bleExtensions/ValidatableExtensions.Collections.cs 87.50% <0.00%> (-12.50%) ⬇️
src/Validators/Validator.Collections.cs 76.27% <0.00%> (-13.73%) ⬇️
src/Common/Validatable.cs 84.21% <100.00%> (ø)
src/Validators/Validator.Strings.cs 83.33% <0.00%> (ø)
...datableExtensions/ValidatableExtensions.Strings.cs 100.00% <0.00%> (ø)
...tensions/ValidatableExtensions.StringProperties.cs 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf9adce...4387d35. Read the comment docs.

/// The default exception thrown is an <see cref="ArgumentException"/>.
/// </remarks>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static IValidatable<IEnumerable<TItem>> IfAny<TItem>(this IValidatable<IEnumerable<TItem>> validatable, Func<TItem, bool> predicate, [CallerArgumentExpression("predicate")] string? predicateName = null)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition:

    this IValidatable<IEnumerable<TItem>> validatable

will box the struct.. Any way around this 🤔?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants