I'm developing an asp.net MVC4 application using entity framework.
Should I hold the context of my entities in an static class to have only one point where to create my context or should I create the context in each controller?
And do I have to call Dispose() by myself or is it done safely from GC (like said in the second answer here: Should Entity Framework Context be Put into Using Statement? ).
If i decide to use the static class, is there a safe point to dispose the context variable ("the end of the application")?
Example of my static class:
public static class ApplicationHelper
{
static ApplicationHelper()
{
Db = new ApplicationEntities();
}
internal static readonly ApplicationEntities Db;
}