python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
IEnumerable vs. IList

"How to Use" IEnumerable and IList [IEnumerable vs. IList]

When you should use IEnumerable and when IList?

You should use IList when you need access by index to your collections and also when you need Add, delete, modify, ordering and / or positioning of your elements in the collections etc.

You should use IEnumerable when you need to enumerate over your collection and represents a forward only cursor and also for querying data from in memory collections like Array, List, and collations etc.


Stayed Informed - IEnumerable vs. IQueryable

Actually, IList interface implements both the interfaces ICollection and IEnumerable and this interface allows us to add, remove, modify and ordering or positioning to items in the collections.

The IList interface has more power than the preceding two interfaces ICollection and IEnumerable.
The IList Interface contains as,
1.      Indexer
2.      Indexof Method
3.      Add Method
4.      Remove Method
5.      RemoveAt Method
6.      Clear Method
7.      Contains Method
8.      Insert Method
9.      IsFixedSize Property
10.  IsReadOnly Property

Stayed Informed - IEnumerable vs. IQueryable

I hope you are enjoying with this post! Please share with you friends. Thank you!!!
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions