If I have a simple class that looks like this:
public string Param1 { get; set; }
public string Param2 { get; set; }
public SimpleClass (string a, string b) { Param1 = a; Param2 = b; }
List of string array returned from another class:
var list = new List<string[]> {new[] {"first", "second"}, new[] {"third", "fourth"}};
Is there a more efficient way using C# to end up with List<SimpleClass> without doing something like:
var list1 = new List<SimpleClass>();
foreach (var i in list)
{
var data = new SimpleClass(i[0], i[1]);
list1.Add(data);
}
foreach, or perhaps a standard library that does such things.