0
我有以下類:我創建一個課程時如何填充IList?
public class CityViewModel
{
public City City { get; set; }
public IList<CityDetail> CityDetails { get; set; }
public class CityDetail()
{
public CityDetail() {
Text = new HtmlText();
ImageFile = String.Empty;
Correct = false;
Explanation = new HtmlText();
}
public bool Correct { get; set; }
public HtmlText Text { get; set; }
public string ImageFile { get; set; }
public HtmlText Explanation { get; set; }
}
我怎樣才能讓這個當我做類似:var model = new CityViewModel();
它創建一個CityViewModel
十CityDetail
記錄?