public static Teacher GetTeacherById(int teachrid)
 {
     objTeacher = new Teacher();
     var teachr = (from teachers in DB.Teachers where teachers.TeacherId == teachrid select teachers).FirstOrDefault();
     objTeacher = (Teacher)teachr;
     DB.Detach(objTeacher);
     return objTeacher;
 }
 /// <summary>
 /// Create a new Teacher object.
 /// </summary>
 /// <param name="teacherId">Initial value of the TeacherId property.</param>
 public static Teacher CreateTeacher(global::System.Int32 teacherId)
 {
     Teacher teacher = new Teacher();
     teacher.TeacherId = teacherId;
     return teacher;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Teachers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTeachers(Teacher teacher)
 {
     base.AddObject("Teachers", teacher);
 }