Changing this up based on the interpretation that by "LINQ" the poster desires query-comprehension syntax instead of dot-syntax (otherwise the other responses suffice):
var query =
from i in list
group i by i.Number into gj
select gj.OrderBy(x => x.Percentage).First();
But this still uses a lot of dot-syntax for the ordering. Which would be the functional equivalent of:
var query =
from i in list
group i by i.Number into gj
select
(from i in gj
orderby i.Percentage
select i).First();
If you don't like the .First()
call on the end, that's going to be a challenge that either will not have a solution within the LINQ language transforms or the solution you end up with will not be the clean solution that IMHO dot syntax provides for this problem. Query comprehensions can often make things simpler, but in this case I prefer the dot-syntax:
var query =
list.GroupBy(i => i.Number)
.Select(gj => gj.OrderBy(i => i.Percentage).First());
The gj.OrderBy(...).First()
portion accomplishes a More-LINQ-style MinBy operation (See Jon Skeet's post)