please tell me What is difference between ToList() & AsQueryable() ?
see the code with AsQueryable()
- var source = (from customer in _context.CustomerTBs.
- OrderBy(a => a.Country)
- select customer).AsQueryable();
- var source = (from customer in _context.CustomerTBs.
- OrderBy(a => a.Country)
- select customer).ToList();
looking for answer in details. thanks

Brajesh KumarRank #678 · 3.5K reputationPosted Mar 15, 2018, 4:54 AM EDT
Tridip BhattacharjeeRank #1,729 · 877 reputationPosted Mar 15, 2018, 11:40 PM EDT
first line
-------------
var ctx = new SchoolDBEntities()
var student = (from s in ctx.Students
where s.departmentid == 10
select s).ToList();
suppose later if i add more condition like
second line
-------------
student = student.Where(s => s.StudentName == "Jeff");
so tell me what will happen when 2nd line will execute. again a new db trip will occur or filter will occur on whatever data will comes from the first query ?
Sagar Pandurang KapRank #606 · 4K reputationPosted Mar 14, 2018, 11:38 PM EDT
Nanddeep NachanRank #38 · 35.2K reputationPosted Mar 15, 2018, 4:33 AM EDT
Brajesh KumarRank #678 · 3.5K reputationPosted Mar 16, 2018, 6:58 PM EDT