Ejemplo n.º 1
0
        public void OpreName()
        {
            var q = from x in Students
                    where x.Course == "opre"
                    select x.Name;

            LinqResultConsole.DisplayResult(q);
        }
Ejemplo n.º 2
0
        public void NamePlusCourses()
        {
            var q = from x in Students
                    join y in DataBase.course on x.Course equals y.courseShortName
                    select new
            {
                StudentName = x.Name,
                CourseName  = y.courseLongName
            };

            LinqResultConsole.DisplayResult(q);
        }
Ejemplo n.º 3
0
        public void CoursesShort()
        {
            var q = from x in Students
                    group x by x.Course into g
                    select new
            {
                CourseName = g.Key,
                CourseAvg  = g.Average(t => t.Mark)
            };

            LinqResultConsole.DisplayResult(q);
        }
Ejemplo n.º 4
0
        public void CoursesLong()
        {
            var q = from x in Students
                    join y in DataBase.course on x.Course equals y.courseShortName
                    group x by y.courseLongName into g
                    select new
            {
                CourseName = g.Key,
                CourseAvg  = g.Average(t => t.Mark)
            };

            LinqResultConsole.DisplayResult(q);
        }