Cristopher Coronado
What is the difference between IEnumerable and ICollection?
By Cristopher Coronado in .NET on Aug 06 2020
  • Kiran Mohanty
    Sep, 2020 8

    When we define a property as IEnumerable, we can only iterate through each items. But when we define a property as ICollection, we can add, edit, update and delete item from the property.

    • 2
  • Uttam Bobalade
    Aug, 2020 9

    IEnumerable interface has only single method - GetEnumerator() and it must return an instance of an object of a class which implements the IEnumerator interface.
    ICollection inherits IEnumerable apart from it contains some more method and IsSynchronized and SyncRoot properties help to make the collection thread-safe. ICollection supports count property too.

    • 2


Most Popular Job Functions


MOST LIKED QUESTIONS