Entity Framework Core ObjectContext.Refresh equivalence

dbcontext entity-framework-core refresh

Question

With Entity Framework 6, it was possible to refresh all the context with the method : _myObjectContext.RefreshAsync(RefreshMode.StoreWins, GetAll())

I would like to do the same thing with Entity Framework Core, but I can't find the best way to do that.

So, what's the best way to refresh all the context with EF Core?

1
0
4/17/2018 1:31:33 PM

Popular Answer

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.

You can track the issue here.

1
4/17/2018 5:53:08 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow