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 me what is .net web service?
what is dotnet architecture? can anyone explain that.
What do you mean by Code Access Security in .NET?
Please explain what is the difference between encrypting a password and applying a hashing?
How to manage pagination in a page using .net?
How do you define the lease of the object in .net?
What is "common language specification" (cls) in .net?
What is .net standard?
When we use windows api in .net is it managed or unmanaged code?
Explain about .NET services?
What are the core differences between .NET Languages ?
Is Driver Script any how related to AOM?
State the differences between the dispose() and finalize().
What are data types in .NET?
What is il in vb.net?