Example #1
0
        static void Main()
        {
            var students      = StudentsInformation.StudentInfo();
            var studentsByAge = from student in students
                                where student.Age >= 18 && student.Age <= 24
                                select new { student.FirstName, student.LastName, student.Age };

            foreach (var student in studentsByAge)
            {
                Console.WriteLine("Student: {0} {1}\nAge: {2}",
                                  student.FirstName, student.LastName, student.Age);
                Console.WriteLine();
            }
        }
Example #2
0
        static void Main()
        {
            var students       = StudentsInformation.StudentInfo();
            var filteredEmails = from student in students
                                 where student.Email.Contains("@abv.bg")
                                 select student;

            foreach (var student in filteredEmails)
            {
                string marks = String.Join(", ", student.Marks);
                Console.WriteLine("Student: {0} {1},\nAge: {2} \nFactualy number: {3}, \nPhone: {4}, \nEmail: {5}, \nMarks: ({6}), \nGroup number: {7}",
                                  student.FirstName, student.LastName, student.Age, student.FacultyNumber, student.Phone, student.Email,
                                  marks, student.GroupNumber);
                Console.WriteLine();
            }
        }
Example #3
0
        static void Main()
        {
            var students = StudentsInformation.StudentInfo();
            var groupTwo = students
                           .Where(a => a.GroupNumber == 2)
                           .OrderBy(a => a.FirstName);

            foreach (var student in groupTwo)
            {
                string marks = String.Join(", ", student.Marks);
                Console.WriteLine("Student: {0} {1},\nAge: {2} \nFactualy number: {3}, \nPhone: {4}, \nEmail: {5}, \nMarks: ({6}), \nGroup number: {7}",
                                  student.FirstName, student.LastName, student.Age, student.FacultyNumber, student.Phone, student.Email,
                                  marks, student.GroupNumber);
                Console.WriteLine();
            }
        }
Example #4
0
 private void ClearResult()
 {
     StudentInformationObject = new StudentsInformation();
 }
Example #5
0
 private void InitiateState()
 {
     studentInformation = new StudentsInformation();
 }