Click here to Skip to main content
15,886,067 members
Articles / Programming Languages / C#

Returning read-only collection

Rate me:
Please Sign up or sign in to vote.
3.60/5 (5 votes)
31 May 2011CPOL 9K   1  
Another good idea is to return the list as enumerable using:return m_privateCollection.AsEnumerable();Now what are the differences?AsReadOnly() creates a completely new collection of list. Depending on the count of items and where the resource is, this may take a long...

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
4 Jun 2011Nick Alexeev 1 alternative  
Returning read-only collection

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Iran
Iran (Islamic Republic of) Iran (Islamic Republic of)
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions