0

Has anyone noticed why the repository in the new WebAPI does not refresh each time a Get request is made? I don't see anything referencing anything like a cache, however, I don't see the data refreshed every time. It is very inconsistent. Any ideas why?

brianhevans
  • 1,183
  • 4
  • 15
  • 28

1 Answers1

0

I had a similar problem and what was happening is that the Database Context was not being disposed after the queries. Check if you're disposing your objects after the connection.

This example helped me on disposing and creating a context per request, the same applies for WebAPI's so they don't keep on the memory and refreshes for every request.

benjamingranados
  • 438
  • 5
  • 15