Reputation: 17366
I want to insert records in multiple tables with entity framework 4.0
My database contains 2 tables
1. Student (StudentID - PrimaryKey)
2. Standard (StudentID - ForeignKey)
How can I add values into these table at one time?
Upvotes: 1
Views: 587
Reputation: 6735
Try this one:
Student student = new Student();
...
Standard standard = new Standard();
standard.Student = student;
/* Commit it */
Upvotes: 2