Hello will try to be as very specific because this is very important to me.
Suppose you have the following table structre:

The following code inserts the data to a specific MvrMeds by using the find method. The find method finds the primary key PKMvrMedsId and then I associate the tables as shown below:
MvrMed MvrMedsTable = DbCtx.MvrMeds.Find(1);
MvrMedsDispensingError DispensingErrorsTable = new MvrMedsDispensingError { MvrMedsDispensingErrorsNameId=2 };
MvrMedsAdministrationError AdministrationErrorsTable = new
MvrMedsTable.MvrMedsDispensingErrors.Add(DispensingErrorsTable);
DbCtx.SaveChanges();
But I am wondering how would I use Mvrs table do the same insert as above:
My First Attempt
Mvr MvrTable = DbCtx.Mvrs.Find(1).include("MvrMeds").include("MvrMedsAdministrationErrors");//intellisense said no to this.
Second Attempt
Mvr MvrTable = DbCtx.Mvrs.Find(1);
var query =(from x in MvrTable.MvrMeds
select x);
MvrMedsDispensingError DispensingErrorsTable1 = new MvrMedsDispensingError { MvrMedsDispensingErrorsNameId = 2 };
query.MvrMedsDispensingError.add(DispensingErrorsTable1);
DbCtx.SaveChanges();
And know I am unsure of how to aproach this without overcomplicating this.
Your context should have n Add methods where n is the number of entities on your model. First create new entities to represent the records that need to go in your tables and then add them to the context using the respective Add method. Then associate the new records to your existing record by looking up the existing one (via find or .where query) and use the association navigation property setters to tie the records together by their relationships. Finally call save changes.
This should be pretty close…