I think it would be wise to configure the context of the Entity object in Application_BeginRequest, save it in Request.items, use it throughout the request and manage it in Application_EndRequest. That way, context is always available, and I can navigate the Entity Framework object graph in my views, lazy loading what I did not want.
I think that would make it work on Ruby on Rails .
Perhaps I would be shot for such a heresy, but it was so simple :(
I cannot get Application_BeginRequest and..EndRequest to start ASP.NET MVC . Aren't they fired? Any special trick I need to do?
asp.net-mvc entity-framework
AndreasKnudsen
source share