- I have a product class (created from EF)
- I have a user class (created from EF)
- A user can have one to many products (UserProduct object created from EF with foreign keys)
What I want to do is
- Create two Products (save off so they have IDs)
- Create a User (don't save yet)
- Create two UserProducts to reference to User
- SaveChanges so that all three get updated
Before I was inserting step 1 and step 2 first, getting the ids, setting up the entitykeyreference for step 3 and saving UserProducts. Doesn't seem like it needs to be this way!