How to move an item to top of list using Linq

Say I have a list of students like the one shown below, and I want a specific item to be on the top of the list.

Here in the example below I want the Student with “Top” as his FirstName to be on the top of the list. So here is how you do it.

var students = new List<Students> { 
    new Students{Id = 1, FirstName = "Yasser", LastName = "Shaikh"},
    new Students{Id = 2, FirstName = "Jayesh", LastName = "Mandal"},
    new Students{Id = 3, FirstName = "Siddhesh", LastName = "Vasani"},
    new Students{Id = 4, FirstName = "Top", LastName = "Top"},
    new Students{Id = 5, FirstName = "Roshan", LastName = "Punwani"}
    }; 

Now there are two methods to do this, I’m gonna show both of them, so here goes..

Method 1:

This method does not work on Linq to Sql.

var students = students.OrderBy(m => m.FirstName != "Top").ToList();

Method 2:

This works on both Linq and Linq to Sql.

var index = students.FindIndex(x => x.FirstName == "Top");
var topItem = students[index];
students.RemoveAt(index);
students.Insert(0, topItem);

Hope you found this useful. Cheers !