objectcontext

Make sure Entity framework always reads from database?

Hi! I have this applikation that is actually two applications, a webapplication and a console application. The console application is used as a scheduled task on the windows machine and is executed 3 times a day to to some recurring work. Both application uses the same Model and repository that is placed in a seperate projekt (class lib...

EF 4: Problems understanding DetectChanges when using POCO (no self tracking ObjectContext)

Hi there, I wonder if anyone can help me? I am having problems understanding why i need to issues DetectChanges on my POCO (non proxy) entities. Of course i have this line to ensure that proxies are not returned. context.ObjectStateManager.GetObjectStateEntry(order).State And doing some research it appears if i need to check the...

Execute a SQL stored procedure before every query generated by EntityFramework

I need to execute a SQL stored procedure every time before I query my ObjectContext. What I want to achieve is setting the CONTEXT_INFO to a value which will be later on used with most of my queries. Has anyone done that? Is that possible? [EDIT] Currently I'm achieving this by opening the connection and executing the stored procedure...

Multiple Entity Framework models and the objectcontext

Hi, I have a asp.net web application that uses Entity Framework. The application data layer uses a method outlined by Jordan Van Gogh found here. In a nutshell, this method uses one shared objectcontext instance per http request and is disposed of using a AspNetObjectContextDisposalModule that inherits IHttpModule. I have added anot...

EF4 - Add object to objectcontext without savechanges

Hi. I have a page like Order - Order lines. Order represents by some textboxes and ddls, Order lines represents by GridView. I want to let users add order lines without save changes to database. For example: he adds 4 order lines, fill order info and then hits Save button. Only an that moment all information should be saved to DB. When...