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
I've tried to save a Entity with 2 entries in the Navigation Property.
But only the main Entity gets saved, the entries in the Navigation Properties are ignored.
Any clue?
The text was updated successfully, but these errors were encountered:
This article describes graph updates in a connected scenario, where the EF change tracker can mark entities as Added or Removed while connected to the database.
In a disconnected scenario, such as a web API, you need another mechanism, such as provided by Trackable Entities. So you need to a) set the Trackable property on objects in your graph, and b) in the web API call ApplyChanges on the root object(s) in your graph. This will walk the graph recursively, informing the EF change tracker of the entity state. Finally, c) call SaveChangeAsync on the DbContext. All changes will then be saved within a single transaction.
Hope this helps!
https://docs.microsoft.com/en-us/ef/core/saving/related-data
I've tried to save a Entity with 2 entries in the Navigation Property.
But only the main Entity gets saved, the entries in the Navigation Properties are ignored.
Any clue?
The text was updated successfully, but these errors were encountered: