I’m fairly new to entity framework and patterns. How would I insert data into a child table?
I inserted the information into the parent table. Do I have to return the identity of the row and then issue another insert?
User Table and User Role.
I’ve been trying to find a solution for a day now, but I think its because I’m searching the wrong results. My structure is set up using Unit of Work/Repository Pattern.
Any help would be helpful. Thanks!
Get the Parent object. Add the child record to it’s navigation property.
something like this
Assuming Order is your Master entity and Detail is your child entity and dbContext is your DBContext class object.
EDIT : If you are adding it together,