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 is the need of vss to developer?
what are ACID properties ?
What is the use of CLR in .NET?
How to upload in video,mp4,in .net 4.5 ..?
Define cache coherency and how is it eliminated? : Dot net architecture
how u maintain data while navigating one page to another?
Can I create my own metadata attributes?
Explain domestic architecture artifacts? : Dot net architecture
what is the shortcutkey for solution explorer and add new item?
How to improve the cache performance? : .NET Architecture
Difference between type constructor and instance constructor?
can aspx page contains two pager tags ?