Home
Manage Your Code
Snippet: Program that uses AsEnumerable method (C#)
Title: Program that uses AsEnumerable method Language: C#
Description: Program that uses AsEnumerable method Views: 353
Author: Partha Das Date Added: 8/27/2012
Copy Code  
1using System;
2using System.Linq;
3
4class Program
5{
6    static void Main()
7    {
8	// Create an array type.

9	int[] array = new int[2];
10	array[0] = 5;
11	array[1] = 6;
12	// Call AsEnumerable method.

13	var query = array.AsEnumerable();
14	foreach (var element in query)
15	{
16	    Console.WriteLine(element);
17	}
18    }
19}