Refreshing entities
Because of the first level cache, reloading an entity with modified database values will not refresh it.
Problem
Entity Framework Core, like other Object-Relational Mappers, uses something called a First Level Cache (also known as Identity Map) to keep track of the entities that it knows about. These are entities that were loaded from the database or ones that have been marked for persistence. This, in general, can be regarded as an optimization: when Entity Framework loads the same record over and over again, it does not need to instantiate the entity's class and hydrate it with the values coming from the database.
The problem is, what if the entity's record changes in the database and we wish to refresh the ones we have? For example, this won't work:
//retrieve an entity from the database var myEntity = ctx.MyEntities.First(); //the entity's record changes in the database //retrieve the entity again //unchanged: is returned from the first level cache...