Skip to content
Advertisement

How to update existing child class by using the parent id

Currently I have somes idea where we get the child data from its parent Id, and update the child data with hardcoded text. Parent Class: `

`

Child Class

The situation is when the when i need to update all child status column to “Confirm”, i need to find it parent class first by search the rideId and if the ride found, it will update their child class attribute. Im using EF core to save the data.

Currently this is my logic to save or update the data, can you guys help me how to update the child class base on parent Id.

Advertisement

Answer

How to add/update child entities when updating a parent entity in EF

I got this solution and modify it with other resource.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement