Answer Posted / puneet meena
while(get_next_record_from_database)
{ yield return your_next_record;}
It allows you to quickly create an object collection (an Enumerator) that you can loop through and retrieve records. The yield return statement handles all the of the code needed to create an enumerator for you.
The big part of the yield return statement is that you don't have to load all the of the items in a collection before returning the collection to the calling method. It allows lazy loading of the collection, so you don't pay the access penalty all at once.
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What tags do you need to add within the asp:datagrid tags to bind columns manually.
What is difference between .net core and .net standard?
Explain the difference between asp.net & vb.net and explain architecture?
Explain me why do we use msmq?
What is Code group in .Net with respect to CAS
What is meant by globalization and localization?
Describe the difference between inline and code behind which is best in a loosely coupled solution?
What is .net latest version?
Explain me how does linq work?
Tell me about secure socket layer? How to make use of the technology?
Tell us what do the following acronyms in .net stand for: il, cil, msil, cli and jit?
What is Ajax design pattern in .NET?
How will you load dynamic assembly? How will create assemblies at run time?
What are asp.net authentication providers and iis security?
What is view state in .net?