I'd like to know the equivalent LINQ-to-Entities code for the following code (which is LINQ-to-SQL):
StudentDataContext db = new StudentDataContext();
Student newStudent = new Student();
newStudent.SName = "Billy-Bob";
db.InsertOnSubmit(newStudent);
db.SubmitChanges();
In other words, I'd like to know how to insert data into an existing point in a database, using LINQ-to-Entities.
Update:
I should clarify that the table I'm inserting into is linked to two other tables with a one-to-many relationship. Is there some way to let the framework handle the updating of primary/foreign key relationships?
Update:
Found the correct answer, see How do I use LINQ-to-Entities to insert data into a specific table?