我无法用字符串键获得价值
...
Dictionary<string, Data> dateDic = new Dictionary<string, Data>();
...
public void GetDataList(string _code, int _startDate, int _limit, out List<Data> _list)
{
_list = (from data in dateDic[_code].Values // <= System.Collections.Generic.KeyNotFoundException!!!
where data.date >= startDate
orderby data.date descending
select data).Take(_limit).ToList<Data>();
}
变量_code
是027410
在观察窗口:
stockShcodeDic[_code] System.Collections.Generic.KeyNotFoundException <= 错误 stockShcodeDic["027410"] {Base.Data} Base.Data <= OK