New LINQ Methods in .NET 9: CountBy, AggregateBy, Index | Beginner-Friendly .NET Tutorial

preview_player
Показать описание
In this beginner-friendly .NET 9 tutorial, we explore the new LINQ methods: CountBy, AggregateBy, and Index. Learn how these methods simplify working with collections and data aggregation in C# by replacing older, more complex techniques. We demonstrate how .NET 9 makes tasks like counting elements, aggregating data, and accessing indexes in a collection easier and more efficient. Perfect for ASP.NET Core developers looking to stay up-to-date with the latest .NET 9 features and improve their LINQ skills.🚀

📚 Learn More:

Connect with me 👋:

👉 Support my work:

Don't Forget to:
👍 Like this video if you found it helpful
🔔 Subscribe for more coding tutorials
💬 Comment if you have any questions or suggestions

Chapters:
0:00 Intro
0:12 New LINQ Methods
0:47 Count Before .NET 9
1:35 CountBy()
2:20 Aggregate Before .NET 9
3:00 AggregateBy()
3:50 Index Before .NET 9
4:44 Index()

#dotnet #csharp #linq #aspnetcore #dotnetcore #dotnet9 #csharp #csharptutorial
Рекомендации по теме
Комментарии
Автор

To be fair, your first two examples are not named correctly. We already had a Count() method as you showed. But what you did not show is that we already had an agregate function that works just like you showed, with the small difference of grouping. The new methods in LINQ are themed around grouping. So execute this given query over subsets of my data. But instead of writing groupBy queries and then aggregating the results per group, it now does all of that under the hood as long as you tell it how to group stuff. So simple and elegant. Good short vid non the less, but be more specific next time about the case. Agregating before dotnet 9 was just a groupby and then aggregating for each group, accumulating the result into a final set. Same for countBy. Well done though.

LordErnie
welcome to shbcf.ru