Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to refresh a context from the database #16491

Open
Tracked by #24106 ...
knightmeister opened this issue Jul 7, 2019 · 10 comments
Open
Tracked by #24106 ...

Ability to refresh a context from the database #16491

knightmeister opened this issue Jul 7, 2019 · 10 comments

Comments

@knightmeister
Copy link

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.

@ajcvickers ajcvickers added this to the Backlog milestone Jul 15, 2019
@ajcvickers
Copy link
Member

Triage: Putting this on the backlog to consider behaviors for DbContext in EF Core similar to ObjectContext.Refresh in the old stack.

@audacity76
Copy link

@ajcvickers Any update on this issue?

@ajcvickers
Copy link
Member

@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.

@QutfulloOchilov
Copy link

@ajcvickers Any update on this issue?

@DamirLisak
Copy link

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);

@ajcvickers
Copy link
Member

@DamirLisak That's not decided yet.

@DamirLisak
Copy link

@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?

@roji
Copy link
Member

roji commented Apr 5, 2023

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.

@hodaschiy
Copy link

@ajcvickers Any update on this issue?

@roji
Copy link
Member

roji commented Jun 16, 2024

@hodaschiy see the comment just above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants