46
1
using System;
2
using System.Linq;
3
using System.Collections.Generic;
4
5
public class Program
6
{
7
public static void Main()
8
{
9
IList<Student> studentList = new List<Student>()
10
{
11
new Student() { StudentID = 1, StudentName = "John", Age = 18, StandardID = 1 } ,
12
new Student() { StudentID = 2, StudentName = "Steve", Age = 21, StandardID = 1 } ,
13
new Student() { StudentID = 3, StudentName = "Bill", Age = 18, StandardID = 2 } ,
14
new Student() { StudentID = 4, StudentName = "Ram" , Age = 20, StandardID = 2 } ,
15
new Student() { StudentID = 5, StudentName = "Ron" , Age = 21 }
16
};
17
18
IList<Standard> standardList = new List<Standard>()
19
{
20
new Standard(){ StandardID = 1, StandardName="Standard 1"},
21
new Standard(){ StandardID = 2, StandardName="Standard 2"},
22
new Standard(){ StandardID = 3, StandardName="Standard 3"}
23
};
24
var teenStudentsName = from s in studentList
Cached Result