Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix:
.Min()
→ Order().FirstOrDefault()
Change `.Min()` to `.Order().FirstOrDefault()` so it won't throw and instead return null when the sequence is empty.
- Loading branch information
1c635c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI
there is a method for this case
DefaultIfEmpty()
https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.defaultifempty?view=net-8.0
so you could say
DefaultIfEmpty().Min()