(#6) Select in LINQ | Projection operations | LINQ tutorial for beginners

  Рет қаралды 33,678

WebGentle

WebGentle

Күн бұрын

Пікірлер: 48
@imanidioli
@imanidioli Жыл бұрын
I am fascinated by power of Linq and your generosity in teaching people at the same time 🙏🙏🙏
@sivacse24
@sivacse24 4 жыл бұрын
In 19:19 with "Select" how to apply/combine "Where" condition with Lambda expression ? in 20:22 the second parameter in Lambda always refer to index value?
@Console.WriteLine
@Console.WriteLine Жыл бұрын
One thing is not clear in the last example. From where index got it's numbers 20:59. I tried to name index something Pindex (emp, Pindex) and it still got the numbers from 0 to 5. And where those numbers got from Lessons are so GOOD!!!
@fizihiro
@fizihiro 2 ай бұрын
Great. Keep sharing and make better world!!
@WebGentle
@WebGentle 2 ай бұрын
Thank you 🙏
@medusa121
@medusa121 4 жыл бұрын
What does "execute" mean? I tried iterating without the .ToList() using foreach and have the same result. what is the purpose of the execution .ToList? Thanks in advance!
@gw4303
@gw4303 4 жыл бұрын
I have the same question
@anacespedes3180
@anacespedes3180 2 жыл бұрын
You don't need to do .ToList(). .ToList() is just to convert the output of the query into a List which would then allow you to use the methods of a list. If all you need is read access and to iterate the list, then don't do .ToList(). If you don't convert, the collection is an ienumerable if i remember correctly. When the video maker said "Execute" Idon't know what he means either but he added confusion saying that word.
@ryuzaki6865
@ryuzaki6865 2 жыл бұрын
Actually, he did use the correct term "Execution". All LINQ Operators can be classified into 2 categories based on their Execution behavior -> 1. Deferred Execution (Examples: Select, Where, Take, Skip, etc.) and 2. Immediate Execution (Examples: Sum, Count, Average, Min, Max, ToList, etc.). In the examples used in this video, he was working with LINQ operators that use Deferred Execution (operators like Select, Where). LINQ queries comprising only operators that use Deferred Execution CAN NOT execute on their own, i.e. for Example: var result = employees.Select(emp => emp.Id); The above query can't Execute on its own to store the collection of "emp.Id" inside the "result" variable. We would need some additional help to Execute the above query, Examples of such "additional help":- --> Using the "foreach" loop to Execute the query by Enumerating through the "result". --> Forcing the query to execute immediately by using one of the operators that use Immediate Execution (like "ToList()").
@funandfood_hyderabad
@funandfood_hyderabad 6 ай бұрын
Thank you for all the videos
@syedabdullah965
@syedabdullah965 2 жыл бұрын
Thank you for such helping content.
@umidbaset717
@umidbaset717 5 жыл бұрын
Very Good Sir, Extremely Helpful
@SuperSayiyajin
@SuperSayiyajin 2 жыл бұрын
Thanks for video.How can we query from Mssql Views not tables?
@rexdai5196
@rexdai5196 2 жыл бұрын
very good tutorial. Could someone add an caption or subtitles for this video? I can' fully understand. Thank you.
@SarfarazAnsari-yb9je
@SarfarazAnsari-yb9je 5 жыл бұрын
Nitish Sir, Agar method mein .ToList() nahi laga rhe hain to bhi data aarha hai console mein... to iska realtime advantage kya hua ? var query = (from emp in employees select emp); var query1 = (from emp in employees select emp).ToList();
@WebGentle
@WebGentle 5 жыл бұрын
This line will not return data. var query = (from emp in employees select emp); But if you use foreach loop then you will get data.
@SarfarazAnsari-yb9je
@SarfarazAnsari-yb9je 5 жыл бұрын
@@WebGentle Yes... correct.. i observed the same thing.. I think here we are getting data from List so its working.. in case of database it will not work... correct ?
@WebGentle
@WebGentle 5 жыл бұрын
@@SarfarazAnsari-yb9je it will work with db also.
@bhavanpreethamch7062
@bhavanpreethamch7062 2 жыл бұрын
Good Explanation Thank You Sir.
@chhavisharma2631
@chhavisharma2631 6 жыл бұрын
👍very good sir .thanks for it
@muneerahmad1428
@muneerahmad1428 4 жыл бұрын
we can use the query inside foreach loop without converting it to the list 21:28;
@ryuzaki6865
@ryuzaki6865 2 жыл бұрын
Basically you'll need to forcefully Execute the query to obtain a result, you can do that by either executing the query inside foreach loop or by using "ToList()" to perform Immediate Execution.
@sametertas7282
@sametertas7282 4 жыл бұрын
It is perfect. Thank you so much
@chinagopireddyravuri4007
@chinagopireddyravuri4007 2 жыл бұрын
Great explaination.
@anacespedes3180
@anacespedes3180 2 жыл бұрын
You don't need .ToList() to make the query "execute". Other than that this video is very helpful.
@ryuzaki6865
@ryuzaki6865 2 жыл бұрын
Actually, he did use the correct term "Execution". All LINQ Operators can be classified into 2 categories based on their Execution behavior -> 1. Deferred Execution (Examples: Select, Where, Take, Skip, etc.) and 2. Immediate Execution (Examples: Sum, Count, Average, Min, Max, ToList, etc.). In the examples used in this video, he was working with LINQ operators that use Deferred Execution (operators like Select, Where). LINQ queries comprising only operators that use Deferred Execution CAN NOT execute on their own, i.e. for Example: var result = employees.Select(emp => emp.Id); The above query can't Execute on its own to store the collection of "emp.Id" inside the "result" variable. We would need some additional help to Execute the above query, Examples of such "additional help":- --> Using the "foreach" loop to Execute the query by Enumerating through the "result". --> Forcing the query to execute immediately by using one of the operators that use Immediate Execution (like "ToList()").
@kaling_108
@kaling_108 4 жыл бұрын
Very good sir. But if the examples were given by using a table then it could have been better for students...
@shinevarghese504
@shinevarghese504 3 ай бұрын
why here you are not using ienumerable ?????
@MuhammadAdnan-gx6rd
@MuhammadAdnan-gx6rd 5 жыл бұрын
Sir do it with database without database it's hard to understand properly and accurately ?
@WebGentle
@WebGentle 5 жыл бұрын
That will be done in entity framework tutorial.
@MuhammadAdnan-gx6rd
@MuhammadAdnan-gx6rd 5 жыл бұрын
@@WebGentle okay thanks
@Uzair_Anwar2299
@Uzair_Anwar2299 5 жыл бұрын
Do have entity framework video??
@trumbaron
@trumbaron 2 жыл бұрын
Very good, thanks!
@kidoo1567
@kidoo1567 Жыл бұрын
Employees have all data and emp have all object once at a time
@schizoscope8703
@schizoscope8703 3 жыл бұрын
Thank you very much!
@sachinrajput4746
@sachinrajput4746 Жыл бұрын
Thank you sir
@narendarsingh4672
@narendarsingh4672 6 жыл бұрын
thanks
@swathihegde7475
@swathihegde7475 5 жыл бұрын
Thanks a lot sir
@1prdas1
@1prdas1 3 жыл бұрын
Thank you
@Sad_Chief
@Sad_Chief 5 ай бұрын
2:23
@ahmaddawood9691
@ahmaddawood9691 Жыл бұрын
You are Super
@WebGentle
@WebGentle Жыл бұрын
Thank you
@anoopmishra5818
@anoopmishra5818 6 жыл бұрын
nice....
@vikaspandey72
@vikaspandey72 6 жыл бұрын
Great
@codewithrimdasilva
@codewithrimdasilva 3 жыл бұрын
Very good
@vinhtran9799
@vinhtran9799 4 жыл бұрын
thanks
@edeal7481
@edeal7481 4 жыл бұрын
slow down bruh
@vaclav5908
@vaclav5908 5 ай бұрын
bro couldnt be slower
How do Entity Framework Core Queries Work?
28:44
Raw Coding
Рет қаралды 27 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Difference between Select and SelectMany in LINQ in C#
7:14
Everything C#
Рет қаралды 6 М.
(#15) Reverse in LINQ | LINQ tutorial for beginners
15:03
WebGentle
Рет қаралды 9 М.
(#22) Except in LINQ | LINQ tutorial for beginners
15:16
WebGentle
Рет қаралды 7 М.
Master C# Interfaces in 12 Minutes - Beginner Tutorial
11:37
tutorialsEU - C#
Рет қаралды 26 М.
LINQ + Lambda expressions - C# tutorial
6:14
Tarodev
Рет қаралды 112 М.
(#9) Where in LINQ | LINQ tutorial for beginners
17:41
WebGentle
Рет қаралды 16 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН