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 re interop services?
What is serialization, how it works in .NET?
deference between display and visibility property of CSS
Explain How to improve the cache performance? : Dot net architecture
readonly syntax ?
how u maintain data while navigating one page to another?
which of the following statement is true about gac. a)it is being handled by .net framwork b)It is special folder c)it can have files with same name etc etc.
when garbage collector come into picture. ?
What are bindings?
how to minimize,maximize and restore my form programmatically?
1 Answers Interlac, Six Sigma,
What is a virtual memory? : Dot net architecture
When do I need to use gc.keepalive?