Class: Episode with properties string name, uint orderNumber and timespan length.
Class: TVserie with episodes[] property.
如何让这样的事情:哪个接口来实现一个项目集合
TVseries breakingBad = new TVseries();
breakingBad.episodes.add(511, "Confessions", 30.00);
哪个接口提供的“添加”和其他集合功能,我的自定义类?
==============================
编辑:谢谢!我将其更改为:
List<Episode> breakingBadSeason5 = new List<Episode>();
Episode episode = new Episode();
episode.Name = "confessions";
breakingBadSeason5.Add(episode);
1)'add'应该大写2)参见['ICollection的。新增'方法](http://msdn.microsoft.com/zh-cn/library/63ywd54z.aspx)MSDN –
CodesInChaos
'uint'不在CLS中;使用'int'或'long'。或者考虑使用字符串作为订单号。这不像你会对它做数学。 –