Using MvcScaffolding with EF4.1, I see that the first generated line of a Controller generally is the following field definition:
public class FooController : Controller
{
private BarContext context = new BarContext();
//.....
where BarContext
is as follows:
public class BarContext : System.Data.Entity.DbContext
Given that System.Data.Entity.DbContext
implements IDisposable
, I am surprised not to find any generated override in FooController
for the Dispose(bool)
method that might take care of disposing context
.
Is this an oversight in the templates, or is there something I'm missing that makes this a non-issue?