I am working on a .net web application for School Management System.

There are 2 DTO objects Subject and Student

Subject.cs

```
public class Subject
    {
        public string SubjectCode { get; set; }
        public string SubjectName { get; set; }
        public int StudentsEnrolled { get; set; }
        public IReadOnlyCollection<Student> Students { get; set; }
    }

```

Student.cs

```
public class Student
    {
        public string StudentId { get; set; }
        public string StudentName { get; set; }
        public int Marks { get; set; }
        public int Status { get; set; }
    }

```

There is an API method 'GetSubjectDetails' where we need to pass the subject name as argument. The output is a Subject object with Subject details and list of students enrolled for that subject.

```
Subject subject = GetSubjectDetails("Mathematics);

```

Now I have the Subject object with all the 50 students list in it.
Now I need to filter the object with only 10 students who got the least marks in that subject. 

How do I filter object. I can do it in either C#.net in server side or in the front end using typescript.