public void EditStudent(Student std) { var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance; using (var context = new TOContext()) { context.Entry(std).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } }
public void DeleteStudent(int ID) { var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance; using (var context = new TOContext()) { var student = context.student.Find(ID); context.Entry(student).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); } }
public void DeleteTeacher(int ID) { var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance; using (var context = new TOContext()) { var teacher = context.teacher.Find(ID); context.Entry(teacher).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); } }