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 does jit compilation do in .net?
What is shared and repeatable inheritance?
What is machine.config in .net?
Define satelite assembly?
What are two different types of remote object creation mode in .net?
Explain how com+ related to the dna architecture?
Can a try block have more than one catch block?
Is .net core the future?
How does cas works?
What's singlecall activation mode used for in .net?
How does u handle this COM components developed in other programming languages in .NET?
What is the difference between override and overload in a method?
Explain the garbage collection process?
How to spawn a thread?
Interop Services?