This is probably a pretty obvious question, but how would I go about creating a List
that has multiple parameters without creating a class.
Example:
var list = new List<string, int>();
list.Add("hello", 1);
I normally would use a class like so:
public class MyClass
{
public String myString {get; set;}
public Int32 myInt32 {get; set;}
}
then create my list by doing:
var list = new List<MyClass>();
list.Add(new MyClass { myString = "hello", myInt32 = 1 });
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…