LINQ Method Syntax vs Query [Pt 17] | C# for Beginners
Vložit
- čas přidán 9. 11. 2023
- View full playlist: aka.ms/dotnet/beginnervideos/...
Set up C# in VS Code: aka.ms/dotnet/get-started/vscode
🏆Earn the C# Certification: aka.ms/csharp-certification
Learn how LINQ composes queries written in multiple statements, or multiple methods, into a single query operation. In this video, examine another approach to writing LINQ queries. This feature will help you create more readable code without compromising runtime efficiency.
Links:
.NET Beginner Videos: aka.ms/dotnetvideos
MS Learn: aka.ms/dotnet/beginnervideos/...
Blog: aka.ms/dotnet/blog
Twitter: aka.ms/dotnet/twitter
TikTok: aka.ms/dotnet/tiktok
Mastodon: aka.ms/dotnet/mastodon
LinkedIn: aka.ms/dotnet/linkedin
Facebook: aka.ms/dotnet/facebook
Docs: learn.microsoft.com/dotnet
Forums: aka.ms/dotnet/forums
🙋♀️Q&A: aka.ms/dotnet-qa
👨🎓Microsoft Learn: aka.ms/learndotnet
#dotnet #csharp - Věda a technologie
Query syntax is familiar but also out of place, it doesn't fee like C#, and I have seen a lot more of LINQ method syntax being used for EF queries.
thanks guys you are the best. 🙏
love david's beard scratching sound
🤣
3:53
LINQ and lambda.
var nums = new List() { 14, 200, 83, 94, 5 };
var queries = nums.Where(x => x < 90).OrderBy(x => x).Select(x => x);
queries.ToList().ForEach(x => Console.WriteLine(x));
you don't need that ToList()
I guess he was trying to explain that whenever you execute that ToList() method, that is the moment when the query actually runs.
The 'ToList()' method is part of the LINQ (Language Integrated Query) extension methods and is available for any collection that implements the 'IEnumerable' interface. The primary advantage of 'ToList()' lies in its ability to convert collections into dynamic lists, which can grow or shrink in size dynamically
What google says