score:2

Accepted answer

For your outputtest list, you can get theMax of dead_alive and blocked_unblocked after grouping, like the following code:

var groups = output.GroupBy(x => x.id_number)
    .Select(y => new cls_entry
    {
        id_number = y.Key,
        dead_alive = y.Max(e => e.dead_alive),
        blocked_unblocked = y.Max(e => e.blocked_unblocked)
    }).ToList();

Documentation of Max method : Max


Related Articles