Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A Good C# Collection

What's a good collection in C# to store the data below:

I have check boxes that bring in a subjectId, varnumber, varname, and title associated with each checkbox.

I need a collection that can be any size, something like ArrayList maybe with maybe:

      list[i][subjectid] = x;
      list[i][varnumber] = x;
      list[i][varname] = x;
      list[i][title] = x;

Any good ideas?

like image 464
chris Avatar asked May 17 '11 23:05

chris


1 Answers

A List<Mumble> where Mumble is a little helper class that stores the properties.

List<Mumble> list = new List<Mumble>();
...
var foo = new Mumble(subjectid);
foo.varnumber = bar;
...
list.Add(foo);
,..
list[i].varname = "something else";
like image 101
Hans Passant Avatar answered Oct 09 '22 05:10

Hans Passant