File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
GrocyScanner.Core/ValueCalculator Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ public BestProductValueCalculator(IValueCalculator valueCalculator)
1111 _valueCalculator = valueCalculator ;
1212 }
1313
14- public Product GetProductWithMostValue ( IEnumerable < Product > products )
14+ public Product ? GetProductWithMostValue ( IEnumerable < Product > products )
1515 {
16- return products . OrderByDescending ( product => _valueCalculator . CalculateValue ( product ) ) . First ( ) ;
16+ return products . MaxBy ( product => _valueCalculator . CalculateValue ( product ) ) ;
1717 }
1818}
Original file line number Diff line number Diff line change @@ -4,5 +4,5 @@ namespace GrocyScanner.Core.ValueCalculator;
44
55public interface IBestValueCalculator
66{
7- public Product GetProductWithMostValue ( IEnumerable < Product > products ) ;
7+ public Product ? GetProductWithMostValue ( IEnumerable < Product > products ) ;
88}
You can’t perform that action at this time.
0 commit comments