Open knightmeister opened 5 years ago
Triage: Putting this on the backlog to consider behaviors for DbContext in EF Core similar to ObjectContext.Refresh
in the old stack.
@ajcvickers Any update on this issue?
@audacity76 This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 5.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
@ajcvickers Any update on this issue?
Will it be also possible to refresh only the affected objects that have been queried from the database like in EF 4 ? In a similar way like https://learn.microsoft.com/en-us/dotnet/api/system.data.objects.objectquery-1.execute?view=netframework-4.8.1
query.Include(c => c.RelatedData)...;
query.MergeOption = MergeOption.OverwriteChanges; // or
query.Execute(MergeOption.OverwriteChanges);
@DamirLisak That's not decided yet.
@ajcvickers When can we expect a decision? ( I'm asking because we urgently need this feature ;-) ) If not, do you have a suggestion for a "MergeOption-Workaround" for refreshing entities?
This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 8.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources. Make sure to vote (👍) for this issue if it is important to you.
@ajcvickers Any update on this issue?
@hodaschiy see the comment just above.
I'm raising this as I've seen #11706 and #2296 are closed.
I require this functionality for GUI applications, for which EF Core is a viable target - specifically via Xamarin and UWP.
It is possible with EF6 to refresh the context by using Refresh(RefreshMode.StoreWins)
I totally understand that contexts are suggested per-unit of work however GUI applications have long living components (such as the main screen) for which a unit of work isn't suitable.
At this stage I have implemented an internal message bus which indicates when a single entity should be reloaded, but it would be nice to be able to refresh the store and all tracked entities in EF Core.