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

What is a service class?

1008


Explain different pipelining hazards? : Dot net architecture

982


How can implement drag and drop using atlas?

1009


Explain domestic architecture artifacts? : .NET Architecture

941


What is .net transaction?

922


6. Wcf- what is SOA

2366


What is .net mobile lists. Explain with an example? : Microsoft dot net mobile

897


What is .net mobile utility controls. : Microsoft dot net mobile

977


which is the institute in hyderabad for providing the live project industry training

2802


Explain how cache is used? : Dot net architecture

1078


How cache coherency is eliminated? : Dot net architecture

920


Explain cache? : Dot net architecture

991


Explain cache? : .NET Architecture

998


What is MS chart control in visual studio?

1235


What are the options provived by vss to the user? how it will help us while delevoping application?

2218