I have two lists and I need to sort a list with another list.
var orderList = new List<long>() {4, 55, 34};
var itemList = new List<Branch>() { {Id=55, Name="X"}, {Id=34, Name="Y"}, {Id=4, Name="Z"} };
How can I order second list namely itemList
according to first one orderList
?
Is there any linq short way?
Update:
orderList
will always have all expected Id
branch contained itemList
.