我的对象 eventTypeList 脱离上下文,即使它在使用中。有什么建议吗?
错误消息:ObjectContext 实例已被释放,不能再用于需要连接的操作。
public ActionResult GetEventTypeList()
{
List<EventType> eventTypeList;
using (var db = new ICTTBEntities())
{
eventTypeList = (from et in db.EventTypes select et).ToList();
var result = new { Result = "OK", Records = eventTypeList };
return Json(result, JsonRequestBehavior.AllowGet);
}
}