But I’m wondering this can be done with a single LINQ query
var priorityItems = list
.GroupBy(x => x.Group)
.Where(grp => groupPririties.Contains(grp.Key))
.OrderBy(grp => groupPririties.IndexOf(grp.Key))
.FirstOrDefault();
CLICK HERE to find out more related problems solutions.