What is Ienumerable
Answer / wasim akhtar
The IEnumerable interface appears throughout C# programs. It specifies that the underlying type implements the GetEnumerator method. It enables the foreach-loop to be used.
Program that uses IEnumerable<T> [C#]
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main()
{
IEnumerable<int> result = from value in Enumerable.Range(0, 2)
select value;
// Loop.
foreach (int value in result)
{
Console.WriteLine(value);
}
// We can use extension methods on IEnumerable<int>
double average = result.Average();
// Extension methods can convert IEnumerable<int>
List<int> list = result.ToList();
int[] array = result.ToArray();
}
}
Output
0
1
| Is This Answer Correct ? | 0 Yes | 0 No |
What actually happes when you add a something to arraylistcollection ?
Tell me .net mobile emulators? : Microsoft dot net mobile
what is the difference between master page and content page?
Can I customise the trace output?
What is password attribute of the textbox control of .net mobile? : Microsoft dot net mobile
What is parallel computing?
Can I create my own context attributes?
can aspx page contains two pager tags ?
What is an interrupt? : .NET Architecture
What are the different access modifier? Explain in detail?
How to prevent my .NET DLL to be decompiled?
if i want to validate all the control on web page how i will do