TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohamed Sherif
NA
15
99.7k
IEnumerable Vs List
Jul 15 2013 8:41 AM
List<Animals> li = new List<Animals>();
Animals n = new Animals();
n.Cat = 1;
n.Dog = 2;
n.tiger = 3;
li.Add(n);
Animals n1 = new Animals();
n1.Cat = 2;
n1.Dog = 2;
n1.tiger = 3;
li.Add(n1);
IEnumerable<Animals> test= li;
foreach (var item in test)
{
Console.WriteLine(item.Cat);
}
foreach (var item in li)
{
Console.WriteLine(item.Cat);
}
Console.Read();
What is the difference between Ienumerable and list.List implements the interface Ienumerable.so it Includes all methods of IEnumerable.
Where should I use IEnumerable<> And List<> respectively.
Please Explain me the difference with an example.
Reply
Answers (
3
)
SELECTONE,DISPLAY ON GRID MANY
How to Get Particular Value From XML file in ASP.NET using C