generic-collections
C# foreach on a collection of an interface
I\'m wondering if there is any functionality built in to C#/LINQ to simplify the following: foreach(var item in collection)[详细]
2023-04-09 03:54 分类:问答Simple generic collection to add elements
What collection should I use from C# that suports generic only for adding elements ? I tried using ArrayList, but I s开发者_开发百科ee that it\'s a non-generic type.[详细]
2023-04-04 06:06 分类:问答Intersect differently typed Collections
I have Collection<A> ca and Collection<B> cb, A and B sharing no common interface but each having a String property called something. I need to filter ca and retain only those elements whi[详细]
2023-03-31 01:02 分类:问答How to filter a List<Customer> filled with Objects
I have a class Person and a list of type List<Person> class person { int id; string FirstName; string LastName;[详细]
2023-02-28 22:42 分类:问答Lists with wildcards cause Generic voodoo error
Does anyone know why the following code does not compile? Neither add() nor addAll() works as expected. Removing the \"? extends\" part makes everything work, but then I would not be able to add subcl[详细]
2023-02-19 11:08 分类:问答How do you find an element index in a Collection<T> inherited class?
How do you find the index of an element in a Collection inherited class? public class MyCollection : Collection<MyClass>[详细]
2023-02-14 11:40 分类:问答SortedList<K,V> vs SortedDictionary<K,V> vs Dictionary<K,V> [duplicate]
This question already has answers here: SortedList<>, SortedDictionary<> and Dictionary<>[详细]
2023-02-13 18:24 分类:问答c# Array or Collection
How would you approach this? I have a list of data that has two things that need to be stored price and item, is there anyway to store this in an array wi开发者_运维技巧thout knowing the total number[详细]
2023-02-12 04:37 分类:问答Use java.util.Map from Scala
I need to use java-legacy code with the following method: public void doit(Map <String, Object> vals) {...}[详细]
2023-02-08 17:04 分类:问答Phone Directory Example
I am trying to make a simple phone directory program in windows console application. I have used SortedDictionary in which Key is name and Value is number, List for address and StringDictionary for em[详细]
2023-02-04 15:21 分类:问答