473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Generic.List vs ObjectModel.Collection

Fx Cop says to use Collection instead of List when exposed in a API, but
always have the pains due to lack of features in Collection.

No Sort.
No Copy To.
No Add Range.
No Predicts.

What is everyone else doing?

Thanks,

Schneider
Jan 23 '07 #1
2 3608
Internally you can work with a list and export to a collection externally.
Externally, once you receive a collection, you can populate a list.
"schneider" <es********@starkinvestments.cemwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
Fx Cop says to use Collection instead of List when exposed in a API, but
always have the pains due to lack of features in Collection.

No Sort.
No Copy To.
No Add Range.
No Predicts.

What is everyone else doing?

Thanks,

Schneider


Jan 23 '07 #2
Hello,

I generally use List<Tinternally and expose it via IList<T>.

Best regards,
Henning Krause

"schneider" <es********@starkinvestments.cemwrote in message
news:ub**************@TK2MSFTNGP02.phx.gbl...
Fx Cop says to use Collection instead of List when exposed in a API, but
always have the pains due to lack of features in Collection.

No Sort.
No Copy To.
No Add Range.
No Predicts.

What is everyone else doing?

Thanks,

Schneider

Jan 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jason Kendall | last post by:
Specifically, I would like a Generic dynamic list that supports referencing items by Index and by Key. I've looked at List(of T), System.Collections.Generic.Dictionary(of Key, Value) and others...
9
by: zacks | last post by:
I have written a serialized class that has several properties that are typed as a list of type class. When I deserialize an XML file, the list is populated just fine. But I am having trouble...
6
by: fstorck | last post by:
Hi, I'm looking for a generic version of a map container that acts similar like the multimap known from C++ / STL . <code> Dictionary<string, myobjectmap = new Dictionary<string,...
7
by: SStory | last post by:
I am doing a Generic.Dictionary(of string,myobject) I need to access the item by key, but also by index. Is this the wrong thing to use? Should I be using something different. In other words...
7
by: Sehboo | last post by:
We have several generic List objects in our project. Some of them have about 1000 items in them. Everytime we have to find something, we have to do a for loop. There is one method which does the...
4
by: =?Utf-8?B?QkogU2FmZGll?= | last post by:
We have a class that has a public property that is of type List<T>. FXCop generates a DoNotExposeGenericLists error, indicating "System.Collections.Generic.List<Tis a generic collection designed...
1
by: JackPot | last post by:
The question being like where is System.Collections.ObjectModel.Collection? I'm using Roeder's Reflector and come across the following: private Collection<int>channelSkipHours; When I click...
13
by: =?Utf-8?B?RGF2ZSBXZWVkZW4=?= | last post by:
Hi all, I'm having trouble with a project that I've distilled down to the following code. Unfortunately it won't compile and gives the following error (caused by the call to GetHorses() in...
2
by: SimonDotException | last post by:
I am trying to use reflection in a property of a base type to inspect the properties of an instance of a type which is derived from that base type, when the properties can themselves be instances of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.