List<dynamic> list = conn.Query(srhsql, p).ToList(); //查出数据
List<dynamic> tmp = new List<dynamic>();
foreach (var row in list)
{
dynamic info = new System.Dynamic.ExpandoObject();
var dic = (IDictionary<string, object>)info;
foreach (KeyValuePair<string, object> col in row)
{
dic.Add(col);
}
dic.Add("bkap", bukaoExist(conn, row.term, row.courseid, row.stid));
tmp.Add(info);
}
list = tmp;
定义一个System.Dynamic.ExpandoObject对象,转成IDictionary,就可以添加属性了