score:2

You can use this query:

listA = listA
    .OrderBy(a => listb.FirstOrDefault(b => b.ID == a.objectB_id)?.Date ?? DateTime.MaxValue)
    .ToList();

This might not be the most efficient approach but it is safe. Because if you use Join it's possible that you get duplicate ObjectA instances if there are duplicate OBjectB(acc. to the ID).


Related Articles