The two solutions presented are bad, one creates a class of class and allocates as crazy being inefficient in memory and processing and another renders the element as a dictionary that does not have the same semantics of a list of lists, or even what you want, so you're talking, because what you want is a list of objects, not lists.
The right solution for what you want (by what you've demonstrated and not by what you've said) has a chance of creating a struct
that takes care of it, something like this:
struct Item { public string AdminId, public string GroupId }
var lista = new List<Item>() { new Item { var1, var2 }, };
I used the name Item
because I do not know what this is about, it should be a better name. I did it in a very simplified way, it would probably be better to do something more complete than this for several reasons.
On the other hand this might even be something fleeting and should not create a type to administer this, which I could only know if I had more details of the application. Here a tuple would be more appropriate, but it would be the modern tuple of C # 7. Something like this:
var lista = new List<(string AdminId, string GroupId)>() { (var1, var2), };
This var1
and var2
are local variables with the content, it does not have to be fine, if the question had the code to create I would do a more detailed example. I used to show with os and initialize the code, and of course I would have to use several items. It might be more interesting to boot into a loop later:
foreach (var item in fonteDeDados) lista.Add((item.AdminId, item.GroupId));
Or using the structure:
foreach (var item in fonteDeDados) lista.Add(new Item() { item.AdminId, item.GroupId });
Of course, I'm considering that the data source that will build your list comes from an object that has the fields or properties with the names I used.