dimanche 20 décembre 2015

Use linq OrderBy to order a list by an ID

I have a list of users that i want to order by an ID. So now the list is ordered by a users fullname like this:

OrderBy(m => m.FullName).ToList();

what i want to do is order this list so a specific id is set to be at the start index.

so the pseudo code would be:

Var passedId = 2123

OrderBy(m=>m.ID); <--- And then set passedId to be in the start index of the list

is this possible ?

thanks.

Aucun commentaire:

Enregistrer un commentaire