var 类型的变量如何用方法返回?
protected dynamic getdata()
{
using (Entities db = new Entities())
{
var data = ......
return data;
}
}
protected void dataInit()
{
var data = getdata();
foreach(var item in data)
{
......
}
}
红色的这句就会报错。。。
The operation cannot be completed because the DbContext has been disposed.