[ASP.NET_MVC]View裡面釋放EF資源的標準寫法
這樣子寫就可以自動在view裡面釋放資源囉
public class TestController : Controller
{
private CyclingEntities db = new CyclingEntities();
protected override void Dispose(bool disposing)
{
if(disposing)
{
db.Dispose();
}
base.Dispose(disposing);
}
}