【发布时间】:2011-05-16 01:28:00
【问题描述】:
我有两个类,想要构建一个包含集合的集合。所以我有..
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; }
}
并且想要达到我可以简单地添加到集合内联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;
}
}
只是想知道正确的方法。
问候
标记
【问题讨论】:
标签: c# .net generics collections