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
Explain assemblies in .net?
Explain me what is encapsulation?
Explain the difference between .net 2000 and .net 2005(features)? Which one is better?
What is view state in .net?
What is the purpose of IClonable interface in .NET?
Explain what is reflection in microsoft .net context?
What is Event Bubbling in .NET?
What are the core differences between .NET Languages ?
Can you explain what do you understand about web service?
Tell us what is heap and what is stack?
Tell me about secure socket layer? How to make use of the technology?
Explain the difference between public and static modifiers?
Do you know what are three common acronyms used in .net, and what do they stand for?
What is WSDL? Explain its architecture?
Interop Services?