public List <Student> GetAll()
 {
     using (var context = new ContextContext())
     {
         return(context.Set <Student>().ToList());
     }
 }
 public Student GetStudentById(int id)
 {
     using (var context = new ContextContext())
     {
         return(context.Set <Student>().Find(id));
     }
 }
 public void Update(Student student)
 {
     using (var context = new ContextContext())
     {
         context.Entry(student).State = EntityState.Modified;
         context.SaveChanges();
     }
 }
 public void Add(Student student)
 {
     using (var context = new ContextContext())
     {
         context.Set <Student>().Add(student);
         context.SaveChanges();
     }
 }
 public void Delete(Student student)
 {
     using (var context = new ContextContext())
     {
         context.Set <Student>().Remove(student);
         context.SaveChanges();
     }
 }