Click here to Skip to main content
15,936,903 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have an MVC app that uses EF 6. In a custom repository, I am updating an entity's CurrentValues via SetValues. A little later on, I have the unit of work perform a Commit(). If, after closing the page on which I made the edits, I return to said page, the changes are not reflected. If I close and reopen my browser, the changes are reflected. What am I missing?

What I have tried:

I've debugged to ensure the code is all executing without any exceptions.
Graeme_Grant 22-Feb-17 18:01pm    
Please post your code so that we can see exactly what you are doing. It could be something like a caching setting. Without code, we can't help as we cannot see your screen from ours.
Valery Possoz 22-Feb-17 18:12pm    
looks like there could be a static property somewhere?
Dave Kreskowiak 22-Feb-17 19:43pm    
What kind of app? If this is a web app you might be getting bit by a page cache.

Normally you save changes with yourDbContext.SaveChanges(), not just a transactionContext.Commit().

Without seeing the relevant code, it's pretty much impossible to tell you what's going on without a ton of guessing.
Dhrup_HK 23-Feb-17 2:11am    
Hay I m also MVC 5 developer, and in my point of view, while use MVC please use custom methods because it's easily understandable even after complex code. but if u r use MVC + entity framework so each time you need to delete model while any if modification in db or any code. in addition to that, it is more difficult to set conditional statement with entity framework.
I M Telling as per my experiences.
Nathan Minier 23-Feb-17 7:19am    
You're being slammed by the page cache by mixing views with AJAX. Pick one and update appropriately after transactions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900