Closed GoogleCodeExporter closed 8 years ago
But, if they return default(T), they would behave differently than regular Max
and Min, who do throw invalidoperationexception ("Sequence contains no
elements").
Original comment by tormod.s...@gmail.com
on 27 Aug 2012 at 10:54
Won't fix since, as per comment #1, it would be surprising for By versions of
the methods to behave differently than their non-By counterparts. You can
achieve the desired effect with DefaultIfEmpty combined with a guard in MinBy,
like this:
var ps = new System.Diagnostics.Process[] {};
var min = ps.DefaultIfEmpty()
.MaxBy(p => p != null ? p.StartTime : (DateTime?) null);
Original comment by azizatif
on 28 Dec 2012 at 10:47
Original issue reported on code.google.com by
nikolay....@gmail.com
on 27 Aug 2012 at 10:37