Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is Ienumerable

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to implement the display in the class printdoc (how to resolve the naming conflict) a: no naming conflicts

1108


Explain dotnet framework ?

1107


Explain pipelining? : Dot net architecture

1048


what is the method while we are using adapter and dataset ?

1915


Explain how does .net mobile work? : Microsoft dot net mobile

906


what are login controls?

1926


How do I know when my thread pool work item has completed?

973


Use of Enable view state ? if turn off what happen ?

4558


What is .net mobile automatic paging? : Microsoft dot net mobile

1030


What is one way operation?

1010


What is a service class?

1054


What re interop services?

1055


So what exactly is the configuration file for then?

1010


What other than biginteger has been introduced in system.numerics namespace?

1005


What is the use of web.config?

1176