I have the following Linq query:
result.Partials.Where(o => o.IsPositive).Min(o => o.Result)
I get an exception when result.Parti
result.Parti
Yet another way to express it in LINQ is to use Aggregate:
var min = result.Partials .Where(o => o.IsPositive) .Select(o => o.Result) .Aggregate(0, Math.Min); // Or any other value which should be returned for empty list