I have two classes and want to build a collection that contains a collection. Thus I have..
public class GenericReportInfo
{
public string ReportName { get; set; }
public string ReportFileName { get; set; }
public Paramaters parameterList { get; set; }
}
public class Paramaters
{
public List<string> parameter { get; set; }
}
And want to get to the point where I can simply add to the collection inline ie
public class GenericReportsInfo
{
public List<GenericReportInfo> CreateAndInitialize()
{
List<GenericReportInfo> reportsList = new List<GenericReportInfo>();
GenericReportInfo info = new GenericReportInfo()
{ "Agent", "Agent", new paramter() {"StateId"} };
return reportsList;
}
}
Just would like know the correct way to get to this.
Regards
Mark
You’re almost there:
I’d like to add a few comments, though:
List<String>).