Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

return last row if all other condition fails in linq c#

var grouped = Mains.GroupBy(l => l.ContactID);
var ids = grouped.Select(g => g.Max(x => x.Id));
var result = grouped.Where(g => ids.Contains(g.Id));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #return #row #condition #fails #linq
ADD COMMENT
Topic
Name
6+3 =