I want to insert into 2 table in 1 controller: example:
db.Entry(record).State = EntityState.Added; db.SaveChanges(); // db.OtherTable.Add(newRecord); db.SaveChanges(); //Error hereThen, i got this error:
I want to insert into 2 table in 1 controller: example:
db.Entry(record).State = EntityState.Added; db.SaveChanges(); // db.OtherTable.Add(newRecord); db.SaveChanges(); //Error hereThen, i got this error: