I have a class:
public class ChartData
{
public Decimal? Value { get; set; }
public DateTime Date { get; set; }
}
And I have also
List<List<ChartData>> chartData = List<List<ChartData>>();
chartData can contains any number of List, it could be one, but also it could be ten lists.
I need this structure flattened. For example if I have two lists in chartData I need to get list of objects where each object contains fields:
{
Decimal? Value0
Decimal? Value1
DateTime Date
}
if I have ten lists I need to get list of objects where each object contains fields:
{
Decimal? Value0
Decimal? Value1
.
.
.
Decimal? Value9
DateTime Date
}
Is it possible to do it using linq or other C# functions?
Thanks in advance.