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

Explain dma? : Dot net architecture

997


Explain domestic architecture artifacts? : .NET Architecture

923


How does .net remoting work?

1070


What is .net viewstate?

894


how we can fire event in databound column in datagrid without using button?

1014


How is the using() pattern useful? What is idisposable?

922


Explain is development of a mobile web application with asp.net is very easy? : Microsoft dot net mobile

928


Explain Intermediate Language?

1044


what are constructors and destructors?

2128


What is the purpose of cache? How is it used? : Dot net architecture

868


Explain the difference between primary & secondary storage device? : Dot net architecture

930


What is a service contract, operation contract and data contract?

925


What is an asssembly qualified name? Is it a filename? How is it different?

924


Explain the difference between state server and sqlserver : Dot net architecture

866


What is the .net class that allows the retrieval of a data element using a unique key?

995