I am fascinated by power of Linq and your generosity in teaching people at the same time 🙏🙏🙏
@sivacse244 жыл бұрын
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 Жыл бұрын
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!!!
@fizihiro2 ай бұрын
Great. Keep sharing and make better world!!
@WebGentle2 ай бұрын
Thank you 🙏
@medusa1214 жыл бұрын
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!
@gw43034 жыл бұрын
I have the same question
@anacespedes31802 жыл бұрын
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.
@ryuzaki68652 жыл бұрын
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_hyderabad6 ай бұрын
Thank you for all the videos
@syedabdullah9652 жыл бұрын
Thank you for such helping content.
@umidbaset7175 жыл бұрын
Very Good Sir, Extremely Helpful
@SuperSayiyajin2 жыл бұрын
Thanks for video.How can we query from Mssql Views not tables?
@rexdai51962 жыл бұрын
very good tutorial. Could someone add an caption or subtitles for this video? I can' fully understand. Thank you.
@SarfarazAnsari-yb9je5 жыл бұрын
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();
@WebGentle5 жыл бұрын
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-yb9je5 жыл бұрын
@@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 ?
@WebGentle5 жыл бұрын
@@SarfarazAnsari-yb9je it will work with db also.
@bhavanpreethamch70622 жыл бұрын
Good Explanation Thank You Sir.
@chhavisharma26316 жыл бұрын
👍very good sir .thanks for it
@muneerahmad14284 жыл бұрын
we can use the query inside foreach loop without converting it to the list 21:28;
@ryuzaki68652 жыл бұрын
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.
@sametertas72824 жыл бұрын
It is perfect. Thank you so much
@chinagopireddyravuri40072 жыл бұрын
Great explaination.
@anacespedes31802 жыл бұрын
You don't need .ToList() to make the query "execute". Other than that this video is very helpful.
@ryuzaki68652 жыл бұрын
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_1084 жыл бұрын
Very good sir. But if the examples were given by using a table then it could have been better for students...
@shinevarghese5043 ай бұрын
why here you are not using ienumerable ?????
@MuhammadAdnan-gx6rd5 жыл бұрын
Sir do it with database without database it's hard to understand properly and accurately ?
@WebGentle5 жыл бұрын
That will be done in entity framework tutorial.
@MuhammadAdnan-gx6rd5 жыл бұрын
@@WebGentle okay thanks
@Uzair_Anwar22995 жыл бұрын
Do have entity framework video??
@trumbaron2 жыл бұрын
Very good, thanks!
@kidoo1567 Жыл бұрын
Employees have all data and emp have all object once at a time