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
Which dll is required to translate xml to sql in internet information server (iis)?
Explain what is an anonymous method and how is it different from a lambda expression?
Explain me why do we use msmq?
Explain the different parts of an assembly?
Can you explain what do you understand about web service?
Explain how do assemblies find each other?
What is Full trust permission set in .Net
What's singleton activation mode in .net?
Write a program to create a user control with name and surname as data members and login as method and also the code to call it.
Is .net front end or backend?
How many design patterns can be created in .net?
When we use windows api in .net is it managed or unmanaged code?
What is the benefit of .net core?
How do I spawn a thread?
Explain what are possible implementations of distributed applications in .net?