Skip to content

EnumerableExtensions.MinBy and MaxBy throw when collection has only null values #135

@NN---

Description

@NN---
string?[] a = { null, null };
var m = a.MinBy(x => x); // throws no InvalidOperationException collection has no elements.

This happens since the methods looks for non default value while the correct is to have an indicator for not empty enumeration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions