을 배치하고있다, 난 내 컨트롤러 매우 간단한 조치를하고 난 The operation cannot be completed because the DbContext has been disposed.
표가 JSON 오류로 - DbContext 내 DBContext 그냥 작동하지 않는 몇 가지 이유
내 간단한 코드는 다음과 같다이 오류를 받고 있어요 합니다 (.toList()는 데이터만을 confrim하는 디버그 읽고 난 (102 개) 요소들의리스트가 될 것이다.)
public ActionResult gettimeoffsets()
{
using (Dal.DbContext dc = new Dal.DbContext())
{
var times = dc.timeZones;
var timelist = times.ToList();
return Json(times, JsonRequestBehavior.AllowGet);
}
}
이것은 나의 시간대 모델
[Table("timeZones")]
public class timeZone
{
[Key]
public String Id { get; set; }
public String BaseUtcOffset { get; set; }
public String DisplayName { get; set; }
public Double tzOffset { get; set; }
}
Dbset을 반환 할 수 없었습니다. 감사하지 않았습니다. –