cc# sort list with list if ids

C#
docs = docs.OrderBy(d => docsIds.IndexOf(d.Id)).ToList();
Source

Also in C#: