Omgili - forum search, search forums  
  

Discussions about collection"

Displaying 1 - 10 out of 695,402 discussions.  
RSS Feed Options
Time Frame: (Any time)   Minimum number of replies: (2)   Minimum number of discussing users: (0)
  |  

Page: 1   2   3   4   5   6   7   8   9   10  
Keep this page open to be updated with the newest discussions automatically.
Hi, What is the method in LINQ to supply a collection of values and check if any/all of these values are in a collection? Thanks
Started by on , 4 posts by 4 people.  
Bool containsAll = (list.Intersect....
List<T> shouldBeContained = ...
List<T> list = ...
I guess this is pretty inefficient but quick and dirty .
You can emulate this via .Intersect() and check if the intersection set has all the required elements .
In .NET (VB), how can I take all of the items in one collection, and add them to a second collection (without losing pre-existing items in the second collection)? I'm looking for something a little more efficient than this: For Each item As Host In hostCollection...
Started by on , 9 posts by 9 people.  
I know you're asking for VB, but in C# you can just use the constructor of the collection Ben's solution does exist for VB.Net: Dim collection As IEnumerable(Of T) Dim instance As New List(collection) Here is the linked documentation....
What are the recommendations for exposing a custom collection vs generic one? e.g public class ImageCollection : Collection<Image> { ... } public class Product { public ImageCollection {get; set;} } VS public class Product { public Collection<...
Started by on , 7 posts by 7 people.  
Extensibility....
If you're building a public API, consider using a custom collection for the following advantages.
Are not interested responding to or watching these collection modifications then a List<T> is a more appropriate type.
Ask your Facebook Friends
I have a business object collection (representing data from the database) that inherits from Collection and has a static method that calls a stored proc and then populates its properties with the data returned. My question is; is it wrong to inherit from...
Started by on , 5 posts by 5 people.  
Also, don't make the method....
Udate: According to author's comments, publishing of all collection methods would make of the Collection.
If it's OK for your business object to provide usual collection methods to the world specify T .
Hi, If do: foreach(var a in col) { a.X = 1; } Will my iterator over the collection become invalid? Thanks
Started by on , 3 posts by 3 people.  
What you can't do is modifying the collection itself (by removing or adding items to it) while iterating.
Your code is valid.
You can access the members of the items in the collection.
What is the best way to convert a non-generic collection to a generic collection? Is there a way to LINQ it? I have the following code. public class TestClass { } public class NonGenericCollection:CollectionBase { public void Add(TestClass a) { List.Add...
Started by on , 4 posts by 4 people.  
Static List<TestClass> ConvertToGenericClass(NonGenericCollection collection) { return of a (possibly) heterogeneous collection, filter it with OfType<T>: public static List<TestClass> ConvertToGenericClass(NonGenericCollection....
I have a concrete class that contains a collection of another concrete class. I would like to expose both classes via interfaces, but I am having trouble figuring out how I can expose the Collection<ConcreteType> member as a Collection<Interface...
Started by on , 10 posts by 10 people.  
Usage looks like this: Collection<INail> IBucket.Nails { get { return new .
collection, converting values to the required type (doesn't require copying all list values to the new collection).
I am looking for an abstract data structure which represents a collection of sets such that no set in the collection is a subset of another set in the collection. This means that on insert the following conditions will be met: A. Inserting an element ...
Started by on , 5 posts by 5 people.  
Add S if you get to the end of the... .
For each existing entry E in the collection of sets, stop if p(S) < p(E) exactly.
Adding a new set S to the existing collection time regardless of N.
Bc is a subset of abcd (as are sets abd and abc) .
If all attributes (or items fields, or data members) of a java collection are thread-safe ( CopyOnWriteArraySet , ConcurrentHashMap , BlockingQueue , ...), can we say that this collection is thread-safe ? an exemple : public class AmIThreadSafe { private...
Started by on , 5 posts by 5 people.  
To use this function to ensure thread-safety: synchronizedCollection(Collection c) Returns a synchronized (thread-safe) collection backed by the specified collection Reading that, it is my opinion that you have to use the above function....
I am aware of http://stackoverflow.com/questions/1174328/passing-a-generic-collection-of-objects-to-a-method-that-requires-a-collection-of How do I do it in .Net 2.0 where I don't have .Cast ??? It has to be reference equality i.e. copies of the list ...
Started by on , 4 posts by 4 people.  
In fact, you could.
If it's your collection (as in you can modify the collection class) you can implement IEnumerable(Of WhateverBase) even if your collection derives from Collection(Of Whatever).
Though.
Page: 1   2   3   4   5   6   7   8   9   10  
More Information


Forum Search About Omgili Help Plugins Forum/Board Owners Privacy

i
In Title
In Topic
In Reply
Exclude
Boost