icollection

What is the better approach to compare a collection with another (architecturely speaking) ?

Here's an example of the architecture approach I favorited as for now: public abstract class CollectionComparer { public virtual SetEqual(IEnumerable enum1, IEnumerable enum2) { if(enum1== null && enum2== null) return true; if(enum1== null && !(enum2== null)) return false; if(!(enum1...

How can I dynamically access user control attributes?

Im trying to create a "user control menu" where links to a page's usercontrols are placed at the top of the page. This will allow me to put several usercontrols on a page and allow the user to jump to that section of the page without scrolling so much. In order to do this, I put each usercontrol in a folder (usercontrols) and gave each...

What is the most basic class that inherits ICollection<T>

I need a generic collection class which I can add to, and enumerate over. Since ICollection<T> inherits from IEnumerable<T>, the class really just needs to inherit from ICollection<T>. Is there a simple generic class in the BCL that just inherits ICollection<T> like a generic version of CollectionBase? If not, then what class comes clo...

Extracting [] elements from form collection - mvc - should use icollection but have mix of types

hi there. have looked at Phil Haacks project on books at http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx which has been useful, but I have a mix of data types. I use a modelview so that i can have a mix of objects, in this case: Order (ie order.id, order.date etc), Customer, SoilSamplingOrder and a list of SoilSam...

converting linq query to icollection

Hi there. I need to take the results of a query: var query = from m in db.SoilSamplingSubJobs where m.order_id == id select m; and prepare as an ICollection so that I can have something like ICollection<SoilSamplingSubJob> subjobs at the moment I create a list, which isnt appropriate to my needs: query.ToList(); what do I do...

Problem With Repository Pattern & Abstract Classes

Hi Guys, Come across a problem with the repository pattern combined with the use of abstract classes. I have a repository which implements a single method returning an ICollection of an abstract type. Here's my abstract class: public abstract class Location { public abstract string Name { get; set; } public abstract LocationTyp...

Collection vs ICollection

I have created a dummy projet for testing collection and ICollection.I have a user class and wanted to create a collection.Example - ICollection<User> users = new Collection<User>(); Collection<User> users = new Collection<User>(); Both code are working fine whether I use Collection or I collection.Now can anyone tell me what is diffe...

Is instantiating a Queue using {a,b,c} possible in C#?

Is it possible to do that in C#? Queue<string> helperStrings = {"right", "left", "up", "down"}; or do I have to produce an array first for that? ...

How to use reflection on a property of type ICollection?

I have a method where I am passing in two object, which have the same property names, and I'm using Reflection to get the values from one object and set the values on the other. My problem is when I come across a property that is a collection, the original is EntityCollection and the one getting set is ObservableCollection, and I'm obvio...