i return any array and get the layout bellow. i get two result of the same Linefromsheetone. I want only one result that should be highest in match (see object 1 and two)(they have common Linefromsheetone ) returns twice but i want only the highest one
Thanks i solved by this code
return message.GroupBy(x => x.LinesofSavitri).SelectMany(x => x.OrderByDescending(y => y.match).Take(1)).ToArray();
What it does is it groups the common order them by descending and take one
© COPYRIGHT 2024 ASPSnippets.com ALL RIGHTS RESERVED.