I have two web-applications (Frontend and Backend).
Both applications share the same database.
On development environment (debug) I launch both simultaneously.
When debugging, if I change value of any field in BackEnd, on FrontEnd changes are not applied. In the database values are changed. (ie Update
passed, SELECT
from Management Studio gives the correct data)
My guess is that on FrontEnd EF stores a local copy of the data.
Changes appear (on FrontEnd) only when I restarted debug.
A code example for FrontEnd:
using (company_unitEntities _fc = new company_unitEntities())
{
var ff = _fc.agency_tamplates_d.ToList();
}
Interesting Fact:
When I add AsNoTracking
method to data load, and watched Prifiler, I discovered that 'SELECT` queries arrive at the server, but the changes do not appear.
using (company_unitEntities _fc = new company_unitEntities())
{
var ff = _fc.agency_tamplates_d.AsNoTracking().ToList();
}
What could be the reason for such behavior EF?
I use: ASP.NET MVC 4, Entity Framework
Thank you!
UPD: FrontEnd and BackEnd use different Entity Data Model.