Use the ObjectContext
instead and call AddToStudentSet(newStudent).
myModel.AddTostudentSet(newStudent);
You are using an old version of Entity Framework. Back then Entity Framework came bundle with System.Data and wasn't a stand alone library. Instead of having Add/AddObject methods on the DbSet/EntitySet the tool generated add methods directly on the ObjectContext and named them according to the name of the entity.
So an entity called Student
would result in a method called AddToStudentSet
Newer versions of EF dropped this approach and instead generate these methods directly on the DbSet.