YouTube2Text

IEnumerable, IEnumerator, IQueryable in C# .NET — Transcript

by Interview Happy · 928 words · 130 segments · language en · Watch on YouTube

Full transcript

  1. 0:01what is I enumerable in C in the code
  2. 0:04here is a list of employee okay and in
  3. 0:07employee class we have ID and name
  4. 0:10property now here we are adding new
  5. 0:13employees in the code list here okay in
  6. 0:15the list here okay then we are running a
  7. 0:17for each Loop to print the employees ID
  8. 0:18and names one by one now the loop is
  9. 0:21working for the employee list this Loop
  10. 0:23is working because uh this Loop how this
  11. 0:26Loop is working because the list is
  12. 0:28derived from I in able interface only
  13. 0:31and I inter I enumerable interface is
  14. 0:34used when we want to iterate among our
  15. 0:37collection classes using a forre loop
  16. 0:40you might not use it directly this iable
  17. 0:44but all our collection classes like list
  18. 0:47which are able to use for each Loop are
  19. 0:50internally using this iable interface
  20. 0:53like if I will right click on this list
  21. 0:55collection and go to the definition and
  22. 0:58see list is derived from from the I
  23. 1:00numerable right that's it so internally
  24. 1:04all the collections are using iable
  25. 1:06interface so then only we are able to
  26. 1:09iterate the loop uh the collections
  27. 1:11through the for each Loop what is the
  28. 1:14difference between I inable and I
  29. 1:16numerator in C let's see the code first
  30. 1:20you know list is using I numerable
  31. 1:22internally right and here we are
  32. 1:24assigning list to I numerable and then
  33. 1:27iterating okay and here is the output
  34. 1:30now you can do the same thing using I
  35. 1:32enumerator also see here we call get
  36. 1:35enumerator method and use move next
  37. 1:37method to iterate through the results
  38. 1:40and it will give exactly the same output
  39. 1:43which iable was giving but the
  40. 1:45difference is iable code looks simp
  41. 1:49looks simple to implement right so
  42. 1:51basically iable internally uses I
  43. 1:55numerator only to iterate The Collection
  44. 1:57via for each Loop but we use I numerable
  45. 2:01because I numerable simplifies the use
  46. 2:04of I numerator see list is inherited
  47. 2:07from I numerable and I numerable uses I
  48. 2:11numerator interface and if you right
  49. 2:14click on I numerable and go to the
  50. 2:16definition then see here you will find
  51. 2:18the get enumerator method which is rning
  52. 2:21the type of the I numerator that's
  53. 2:26it now here is a very important question
  54. 2:29what is the difference between I
  55. 2:31numerable and I queriable in C why to
  56. 2:34use I queriable for SQL queries we
  57. 2:38already know what is I enumerable right
  58. 2:40now we will more focus on I quable first
  59. 2:44remember this point about I quable I
  60. 2:47quable inherited from I numerable
  61. 2:49interface only so anything you can do
  62. 2:52with I numerable you can also do that
  63. 2:55with I variable also for example
  64. 2:58iterating the collection can be done by
  65. 3:00both I numerable and I variable when you
  66. 3:04right click and see the definition of I
  67. 3:06quable you will find this see I quable
  68. 3:09is inherited from I numerable so
  69. 3:12whatever I numerable can do I queriable
  70. 3:15can also do in addition I queriable can
  71. 3:18perform some extra tasks related to SQL
  72. 3:21queries that I will shortly explain okay
  73. 3:25now see the code here here we have a
  74. 3:27list which we are iterating using I
  75. 3:30numerable and here is the output now we
  76. 3:33can use I quable also to iterate the
  77. 3:36same list and we will get the same
  78. 3:38result now the point is why we need I
  79. 3:42quable when I enumerable is already
  80. 3:44there the reason is inable is used with
  81. 3:49and it is preferred with in memory
  82. 3:51collections like array array list all
  83. 3:54these are in memory collections in
  84. 3:56memory objects also you can see whereas
  85. 3:59I variable is better in getting results
  86. 4:02from database so suppose you want to get
  87. 4:05records from database through linku okay
  88. 4:08for that first you will uh first of you
  89. 4:12you will use iable like this uh do not
  90. 4:15worry about the linku and Lambda
  91. 4:17expression here that I will explain in
  92. 4:19other videos but you are understanding
  93. 4:22this right here here we are getting the
  94. 4:24records from the employees table where
  95. 4:27the employees name start with h right
  96. 4:30and you will get the filtered result in
  97. 4:33this list e okay now the same result you
  98. 4:36can get by using I queriable interface
  99. 4:39also see the same query and you will get
  100. 4:42the same result in list Q this time but
  101. 4:46the point is I quable will take less
  102. 4:49time as comparison to I numerable now
  103. 4:52let me explain this
  104. 4:54why if you use iable then first the
  105. 4:58request will go to the database and
  106. 5:00bring the whole data from the database
  107. 5:03and then the filter the result at the
  108. 5:06server side here so bringing the whole
  109. 5:09data from the network will impact the
  110. 5:11performance in a negative way right
  111. 5:14because the data is too much okay on the
  112. 5:17other hand if you use iable then the the
  113. 5:22request will go to the database filter
  114. 5:24the data then and there only and then
  115. 5:27send back the filtered data data not the
  116. 5:30whole data which is good for performance
  117. 5:33because data is lesser the filter data
  118. 5:35is lesser so that is the reason I
  119. 5:38queriable is better than I enumerable
  120. 5:41for SQL queries and database operation
  121. 5:44all the points I have explain I have
  122. 5:47said are written here only so that later
  123. 5:50anyone can refer this uh PowerPoint and
  124. 5:53for the revision
  125. 5:54purpose one more point I variable is
  126. 5:57under system. linku name space whereas
  127. 6:00iable is under system. collections name
  128. 6:04space that is all about I nameable and I
  129. 6:07quable
  130. 6:09[Music]

About this transcript

This page contains the full transcript of IEnumerable, IEnumerator, IQueryable in C# .NET by Interview Happy, generated from the public captions YouTube serves with the video. The transcript has 928 words across 130 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.