title: EF Core and caching of results
body: <p>I'm working on an Websocket application. When the client connects to the server, the websocket session get one dbcontext from dependency injection</p>
  
  <pre><code>Services.AddDbContext&lt;Db&gt;
  </code></pre>
  
  <p>This dbcontext will be the same for the whole websocket session. The problem is that the dbcontext will cache results. So if the websocket session is open for for example two hours and its reading the same data twice, while the data has been changed outside that dbcontext, the dbContext will give give invalid data back as response for the query. (the cached result from last query). There is serveral examples on how to avoid this, but it has to be done on every query. This is not really practical and somewhere in the code it might be forgotten and you have a chance to get invalid data.</p>
  
  <p>Is there someway to permanently disable caching?</p>