using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
class
GFG{
public
class
Student {
public
string
First
{
get
;
set
;
}
public
string
Last
{
get
;
set
;
}
public
int
Roll_No
{
get
;
set
;
}
public
List<
int
> Marks;
public
Information GetInformation(GFG gfg,
int
roll_no)
{
Information allinfo = (
from
ci
in
gfg.contactList
where
ci.Roll_No
== roll_no
select
ci).FirstOrDefault();
return
allinfo;
}
public
override
string
ToString()
{
return
First +
""
+ Last +
" : "
+ Roll_No;
}
}
public
class
Information
{
public
int
Roll_No
{
get
;
set
;
}
public
string
Email
{
get
;
set
;
}
public
string
Phone
{
get
;
set
;
}
public
override
string
ToString()
{
return
Email +
","
+ Phone;
}
}
public
class
ScoreInfo
{
public
double
Average
{
get
;
set
;
}
public
int
Roll_No
{
get
;
set
;
}
}
List<Student> students =
new
List<Student>() {
new
Student{ First =
"Bhuwanesh"
, Last =
"Nainwal"
, Roll_No = 1,
Marks =
new
List<
int
>(){ 97, 92, 81, 60 } },
new
Student{ First =
"Harshit"
, Last =
"Nainwal"
, Roll_No = 2,
Marks =
new
List<
int
>(){ 75, 84, 91, 39 } },
new
Student{ First =
"Shivani"
, Last =
"Mehta"
, Roll_No = 3,
Marks =
new
List<
int
>(){ 88, 94, 65, 91 } },
new
Student{ First =
"Neha"
, Last =
"Singh"
, Roll_No = 4,
Marks =
new
List<
int
>(){ 97, 89, 85, 82 } },
};
List<Information> contactList =
new
List<Information>() {
Phone =
"6131341379"
},
Phone =
"2131341379"
},
Phone =
"1234561456"
},
Phone =
"5131341379"
}
};
static
public
void
Main()
{
GFG gfg =
new
GFG();
IEnumerable<String> studentQuery2
=
from
student
in
gfg.students
where
student.Roll_No >
2
select
student.Last;
Console.WriteLine(
"student Query:"
);
foreach
(
string
s
in
studentQuery2)
{
Console.WriteLine(s);
}
Console.ReadLine();
}
}