Celso Miranda
New member
- Joined
- Aug 19, 2021
- Messages
- 3
- Programming Experience
- 1-3
I have the following list
I need to sort this list by prioritizing the StudentId that has duplicates in the list, as follows:
Result:
{ StudentId:1, StudentId:2, StudentId:3, StudentId:1, StudentId:2, StudentId:3 }
Help!
C#:
IList studentTeste = new List() {
new Student() { Id = 1, StudentId = 1, StudentName = "John"} ,
new Student() { Id = 2, StudentId = 1, StudentName = "John"} ,
new Student() { Id = 3, StudentId = 2, StudentName = "Ram"} ,
new Student() { Id = 4, StudentId = 2, StudentName = "Ram"} ,
new Student() { Id = 5, StudentId = 3, StudentName = "Bill"} ,
new Student() { Id = 6, StudentId = 3, StudentName = "Bill"}
};
Result:
{ StudentId:1, StudentId:2, StudentId:3, StudentId:1, StudentId:2, StudentId:3 }
Help!
Last edited by a moderator: