IEnumerable vs IQueryable

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 43

  • @CodingTutorialsAreGo
    @CodingTutorialsAreGo  4 роки тому +1

    Source code available here: github.com/JasperKent/IQueryable-vs-IEnumerable

  • @ShyamSharma-pg1zu
    @ShyamSharma-pg1zu 3 роки тому +6

    You have created best C# video on youtube. Thanks a lot Sir

  • @bartoszcwiakala8916
    @bartoszcwiakala8916 Рік тому +3

    Thank you for the great explanation!

  • @elizabethgrant6018
    @elizabethgrant6018 3 роки тому +3

    Amazing video! Thank you so much, clear and understandable

  • @thuyuyenlovely8053
    @thuyuyenlovely8053 3 роки тому +1

    Amazing!
    simple , clear and easy to understand

  • @sabitkondakc9147
    @sabitkondakc9147 3 роки тому +1

    That's an awesome explanation, thanks a million.

  • @finwwwfinwww4669
    @finwwwfinwww4669 2 роки тому +1

    thanks a million. this channel is a gem

  • @ShyamSharma-pg1zu
    @ShyamSharma-pg1zu 3 роки тому +1

    I would like to see more videos on C#, EF Core and Design pattern

  • @juliangallolondono265
    @juliangallolondono265 Рік тому +1

    Wow this video was so helpful

  • @carsugarmodels
    @carsugarmodels 2 роки тому +1

    Great explanation. Thanks. Just subscribed.

  • @peternguyen9382
    @peternguyen9382 Рік тому +1

    thanks so much for your work! Can you do the video on IQueryProvider interface. I have to write UT for my project but i got the error "the source 'iqueryable' doesn't implement 'iasyncenumerable moq". Then i do the search on stackoveflow they said i have to create Linq Provider for my List which i have to implement IQueryProvider, but i dont know how to implement this interface. thanks

  • @wrathrowe
    @wrathrowe 3 роки тому +1

    Noob question: How do I run the .sql command? Is it possible to do in Visual Studio 2019?

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  3 роки тому

      You mean run a file with a '.sql' suffix?

    • @wrathrowe
      @wrathrowe 3 роки тому

      @@CodingTutorialsAreGo Yes, the CreateSampleDB.sql in the Git repo. :)

  • @sunshinaudubon2558
    @sunshinaudubon2558 3 роки тому +1

    amazing tutorials, like!

  • @dannydan999999
    @dannydan999999 3 роки тому +1

    thanks for the explanation! only one thing I didn't get: your line under your goatee is not exactly centred and it buggged me towards the end. LOL

  • @Schnickalodeon
    @Schnickalodeon 3 роки тому +2

    As Always a very informative and good Video Thank you! :)
    Could you make a Video about Logging?
    That would be very nice

  • @adrien8768
    @adrien8768 3 роки тому +1

    Thanks :) more c# videos :)

  • @andrewmerrell1913
    @andrewmerrell1913 3 роки тому +1

    Thanks!

  • @abugsbunny
    @abugsbunny 2 роки тому +1

    Many thank. great

  • @elizabethgrant6018
    @elizabethgrant6018 3 роки тому +3

    Спасибо огромное тому, кто добавил русские субтитры :)

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  3 роки тому +2

      I hadn't noticed someone had done that done that. Спасибо also from me.

    • @SHILY-PROJECT
      @SHILY-PROJECT 2 роки тому +1

      В яндекс браузере можно ещё и озвучку включить (★ ω ★)

  • @MrShapronForU
    @MrShapronForU 3 роки тому +1

    thanks alot!

  • @nipundesilva9306
    @nipundesilva9306 4 роки тому +1

    Nice 👍

  • @stevenkjames
    @stevenkjames 2 роки тому +1

    Cool

  • @bribit8021
    @bribit8021 2 роки тому +1

    I can see nothing, cause your font made me blind!

  • @redcrafterlppa303
    @redcrafterlppa303 2 роки тому

    That's so stupid. Extension methods should be dynamic dispatch. This is something most people will never know until they run into an obscure bug that will take hours to debug

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  2 роки тому

      Problem is that LINQ simply wouldn't work without static binding.

    • @redcrafterlppa303
      @redcrafterlppa303 2 роки тому

      @@CodingTutorialsAreGo why? Linq is basically a bunch of extensions methods. The problem is that extension methods are not virtual (not possible in c# as far as I know). If extension methods could be overridden in this example count in IQueryable could override the IEnumerable count in this object instance. And since IQueryable is a nearer supertype it would be chosen instead of the IEnumerable one.

    • @CodingTutorialsAreGo
      @CodingTutorialsAreGo  2 роки тому

      @@redcrafterlppa303 The problem is that a LINQ query supports multiple interfaces, for example both IEnumerable and IOrderedEnumerable, which have different extensions methods. IEnumerable only has an OrderBy() extension method, whereas IOrderedEnumerable also has a ThenBy(). If it worked polymorphically, then all queries would have to provide ThenBy(), but would give a runtime error if the query hadn't previously been ordered. It could have been made to work that way, but using static binding means we get compile time errors rather than runtime errors, which is generally a good thing. But there are downsides, as described in the video.

    • @redcrafterlppa303
      @redcrafterlppa303 2 роки тому +1

      @@CodingTutorialsAreGo Every implementation decision has its ups and downs. In this example they probably didn't even think about it because c# simply doesn't support virtual extensions without some manual trickery. It just brakes the "use the highest interface possible" guideline because of the changed behavior.

  • @jonathanbuttigieg3232
    @jonathanbuttigieg3232 2 роки тому

    What do you think of using ToList() method and creating two methods one for the listing of customers and the other for the count of customers. What do you think of this approach?

  • @useraccount5881
    @useraccount5881 2 місяці тому +1

    Awesome explanation. Thank you.