IEnumerable 🆚 IEnumerator Interfaces in C#

Поделиться
HTML-код
  • Опубликовано: 19 апр 2021
  • 🚀 Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
    Today's Advanced C# Topic is: IEnumerable and IEnumerator Interfaces
    In this video you will learn what IEnumerable and IEnumerator are
    What are advantages of IEnumerable and IEnumerator
    When to use them
    How to use them
    What are advantages of using IEnumerable and IEnumerato
    How IEnumerator and IEnumerable are related to lists, arrays, and other types of colletions.
    The IEnumerable interface is the base Interface for many collections in C#, and its job is to provide a way of iteration through a collection. That is why we can use foreach loops to go through a List or a Dictionary. In simple English when a collection class implements the IEnumerable interface it becomes countable, and we can count each element in it individually
    There are 2 versions of the IEnumerable Interface
    1.IEnumerable for generic collections
    2.IEnumerable for non generic collections
    But since generic collections were introduced later after the non-generic ones and it is no longer recommended to use the non-generic collections in a new project due to their need to perform boxing and unboxing (converting the types of objects), we will explain how to use the IEnumerable T interface in this lesson
    when it is recommended to use the IEnumerable interface:
    - Your collection represents a massive database table, you don’t want to copy the entire thing into memory and cause performance issues in your application.
    When it is not recommended to use the IEnumerable interface:
    - You need the results right away and are possibly mutating / editing the objects later on. In this case, it is better to use an Array or a List
    ienumerable vs ienumerator C#
    implementing ienumerable and ienumerator
    use of ienumerable and ienumerator in c#
    ienumerator in c example
    ienumerable vs ienumerablet
    why we use ienumerable in c
    ienumerable vs enumerable c
    ienumerator in c# geeksforgeeks
    interface in c# with example code project
    tutorialsEU offers you free video tutorials about programming and development for complete beginners up to experienced programmers.
    This includes C#, Unity, Python, Android, Kotlin, Machine Learning, etc.
    Stay tuned and subscribe to tutorialsEU: goo.gl/rBFh3x

Комментарии • 41

  • @tutorialsEU
    @tutorialsEU  3 года назад +4

    🚀Master C# and .NET programming EASILY with our best-selling C# Masterclass: bit.ly/47Hk3u7
    Here is an article about IEnumerable and IEnumerator Interfaces with a complete code, enjoy!
    tutorials.eu/ienumerable-and-ienumerator/

  • @syafiighazali
    @syafiighazali 3 года назад +9

    Super clear explanation - exactly what I needed!

  • @lowkeyhuman
    @lowkeyhuman 2 года назад +6

    This is some top tier explanation, I have no choice but to subscribe :)

  • @DanFlakes
    @DanFlakes 3 года назад

    Thanks for clearing it up!

  • @dayday8421
    @dayday8421 3 года назад +1

    Best explanation on RUclips. Thank you!

  • @bryanburger
    @bryanburger 2 года назад +1

    Great job at conveying the principles!

  • @siestitrokot3843
    @siestitrokot3843 2 года назад

    Great demo! Thank you!

  • @FumeCreates
    @FumeCreates 3 года назад +1

    Thank you so much for this video. Well explained and I received so much value

  • @juniorlucival
    @juniorlucival 2 года назад +1

    top top top, thanks, you are the best c# teacher .

  • @Gojam12
    @Gojam12 2 года назад

    Good practical and usable explanation

  • @Javier-uh7mb
    @Javier-uh7mb 3 года назад +1

    Very interesting, thanks!

  • @simonroyjonesuk
    @simonroyjonesuk Год назад

    Wow that was brilliant. I finally understand what IEnumerable does. I didn't know what a queue was, so I watched your video on that, which was also great. So well explained and really helpful. You are definitely my new go to source for C#. Thanks again. Simon

  • @mrYtuser01
    @mrYtuser01 Год назад

    Clean and Simple

  • @heshamabdo6024
    @heshamabdo6024 Год назад

    Thank you so much for this video

  • @angel_machariel
    @angel_machariel Год назад +1

    Good video. Question: how relevant is it to learn how to implement IEnumerator ? Should it be an urgent matter for post-beginner students/juniors or shouldn't one be bothered with it for now?

  • @shubhangimane8556
    @shubhangimane8556 3 года назад +1

    nice video

  • @RealityCheck6T9
    @RealityCheck6T9 2 года назад

    Good video thanks

  • @carlossantamaria1820
    @carlossantamaria1820 Год назад

    amazing video, now i understood what this mean, this video also helped me to see the importance of interfaces in general, not only IEnumerable interface.

  • @BackeB
    @BackeB Год назад

    The first ”ahaa” moment I’ve had regarding interfaces, when you described the issues presented without interfaces. So they provide similar functionality among othervise unrelated classes. For example 😁

  • @oaksoeaung7646
    @oaksoeaung7646 2 месяца назад

    Thanks, a lot. This video helps me a lot.

  • @andrewfedorov9198
    @andrewfedorov9198 Год назад

    Well. I got the examples but I didn't get the main idea why do we need this "IEnumerable" thing? To treat List and int array with the same function? At the end they both are so we can collect List values to array first and just make a function to work only with arrays. Or array to list. Because they both are . So why do we need all of this?

  • @nikolazagorac8634
    @nikolazagorac8634 Год назад

    Great video, why can't I save it?

  • @user-hg5sw1tj4u
    @user-hg5sw1tj4u Год назад

    So we use IEnumerable, when we want introduce class like array or list. Yes?

  • @oblivion3799
    @oblivion3799 2 года назад

    Thank you ... you didn't cover anything necessary about it ... Very elementary ... but It helpful yet

  • @danielbereketsiyum825
    @danielbereketsiyum825 10 месяцев назад

    Can we consider this as runtime polymorphism, because the IEnumerable interface is holding different array types at runtime?
    Thank you.

  • @youtischia
    @youtischia 2 года назад

    Good video but can you explain why it is necessary to have 2 interfaces Ienumerable and Ienumerator ? What is the need for Ienumerable when it is Ienumerator that does all the work ?

    • @maythesciencebewithyou
      @maythesciencebewithyou 2 года назад

      from what I've heard, it's because when C# came out it didn't have generics yet and they built it on that.

  • @andreashecht272
    @andreashecht272 2 года назад +2

    so just a logical question:
    Why don't we just make dogs a public list and itterate in the foreach loop through shelter.dogs?

    • @TheKr0ckeR
      @TheKr0ckeR 2 года назад

      i have the same question in my head

  • @TheKr0ckeR
    @TheKr0ckeR 2 года назад

    Instead of going, foreach loop shelter, couldnt we just loop though => shelter.dogs in the foreach looop since its public list?

  • @malcox5218
    @malcox5218 2 года назад

    7:38

  • @stbny4444
    @stbny4444 Год назад

    was following until you called dogs.GetEnumerator(). This function was never defined. What does GetEnumerator() actually do? Where's the implementation?

  • @melone2848
    @melone2848 2 года назад

    Kartoffelsalat

  • @Mike-tb9xq
    @Mike-tb9xq Год назад

    Why couldn't you just use shelter.dogs in your foreach loop?

  • @Gojam12
    @Gojam12 2 года назад

    too basic

  • @muhammedozalp
    @muhammedozalp Год назад

    I am just at the beginning of the video. But please remove that weird animations if your target audience is not under 5 years old kids. They are so distracting.

    • @oladipotimothy6007
      @oladipotimothy6007 Год назад

      loosen up 😀

    • @user-qv1yb2qc5s
      @user-qv1yb2qc5s 8 месяцев назад

      Books exists though, you can use them and surely don't gonna find any animation within...

  • @thomasjust2663
    @thomasjust2663 Год назад

    The cartons and images seriously detract from the usefulness of the video, also by having the IDE do the work, you are actually are creating programmers who don't know truly what they are doing, thumbs down and I would recommend anyone from staying away from your courses