You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@viveknuna There isn't currently an equivalent in EF Core. context.Entry(foo).Reload() is currently the closest thing, but it only works on a single entity.
In general, we recommend using short-lived contexts that cover a single unit-of-work. This usually makes reloading from the store unnecessary.
Activity
ajcvickers commentedon Apr 17, 2018
@viveknuna There isn't currently an equivalent in EF Core.
context.Entry(foo).Reload()is currently the closest thing, but it only works on a single entity.In general, we recommend using short-lived contexts that cover a single unit-of-work. This usually makes reloading from the store unnecessary.
viveknuna commentedon Apr 17, 2018
Could you please explain “short-lived contexts that cover a single unit-of-work”. Please provide sample code if possible.
ajcvickers commentedon Apr 17, 2018
@viveknuna That is, create a context instance, query for the relevant entities, make changes, save changes, dispose of the context. See https://www.martinfowler.com/eaaCatalog/unitOfWork.html for info on the unit-of-work-pattern.
ajcvickers commentedon Apr 18, 2018
Closing as duplicate of #2296