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
You can use the DefaultIfEmpty method to ensure the collection has at least 1 item:
DefaultIfEmpty
result.Partials.Where(o => o.IsPositive).Select(o => o.Result).DefaultIfEmpty().Min();