Using InboundNavigation in TrackGraph
See original GitHub issueUsing TrackGraph
, I would like to be able to set the state of an entity to Added if it is a child in a one-to-many relationship and the parent entity state is Added. For example, if an Order is in an Added state, then I would like to be able to set the OrderDetail to Added as well.
I notice that EntityEntryGraphNode
has an InboundNavigation
property. Is it possible to use it to find the relationship type and a pointer to the entity on the other side of the relationship?
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
EntityEntryGraphNode.InboundNavigation Property
Gets the navigation property that is being traversed to reach this node in the graph.
Read more >How InboudNavigation works in c# - Stack Overflow
InboundNavigation, this field show me path whick track graph passed to the node I not completely undestand how its work If i have...
Read more >Change Tracking Mixed-State Graphs in EF Core
Julie says that integration testing is the key to tracking changes in EF Core. Learn what you need to know to get up...
Read more >ChangeTracker.TrackGraph() in Entity Framework Core
The ChangeTracker.TrackGraph() method begins tracking an entity and any entities that are reachable by traversing it's navigation properties. The specified ...
Read more >4. Working with Disconnected Entities Including N-Tier ...
Using navigation properties to define relationships You aren't restricted to using the foreign key property to change relationships. You can still use the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@tonysneed Something like this:
But that only works if the FK is mapped and an the property values are set before calling Add. See #7389.
@ajcvickers Thanks, this is helpful. However, I will need access to the referencing entity, as proposed in #7389, because the FK and parent entity may not have the key set because it is an auto-generated identity column.