LINQ Method Syntax vs Query [Pt 17] | C# for Beginners

Sdílet
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

Komentáře • 8

  • @ianharcourtsmith
    @ianharcourtsmith Před měsícem +1

    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.

  • @MrKazha0098
    @MrKazha0098 Před 2 měsíci +1

    thanks guys you are the best. 🙏

  • @user-dd1rx9dg9v
    @user-dd1rx9dg9v Před 22 dny

    love david's beard scratching sound

  • @kvelez
    @kvelez Před 6 měsíci

    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));

  • @DickBakerSql
    @DickBakerSql Před 6 měsíci +1

    you don't need that ToList()

    • @cristiancapusan9149
      @cristiancapusan9149 Před 6 měsíci +4

      I guess he was trying to explain that whenever you execute that ToList() method, that is the moment when the query actually runs.

    • @jessedv5915
      @jessedv5915 Před 5 dny

      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