我目前有三个模型类:
public class MarketReport
{
public MarketReportAbbrStores LISTOFSTORESUMMARY {get; set;}
}
public class MarketReportAbbrStores : List<AbbrStore>
{
public AbbrStore abbrStore { get; set; }
}
public class AbbrStore
{
public string StoreName { get; set; }
public int MemberCount { get; set; }
public int LeaderCount { get; set; }
public int ActivistCount { get; set; }
}
现在,我不知道我是否正确地执行了上述操作,但我想在 MarketReport 中填充列表
foreach (var store in stores)
{
AbbrStore abbrstore = new AbbrStore();
abbrstore.StoreName = store;
marketInformation.LISTOFSTORESUMMARY.Add(abbrstore);
//ERROR: Object reference not set to an instance of an object.
}