I have a strange problem with the Entity Framework:
I have a SQL Server database on a Windows Server and I access it via my app through Entity Framework.
Now I c
Entity Framework caches objects internally in a DbContext
instance. Those are meant to be short-lived, the purpose of the caching is so that every time you look up an entity with the same ID you get the same actual instance of said entity back.
This means that when using Entity Framework, you shouldn't store a DbContext
in a static
field. Create a new one for every request.