예제 #1
0
 public void Adiciona(ComunicadoAluno ca)
 {
     using (var contexto = new SalaContext())
     {
         contexto.ComunicadoAluno.Add(ca);
         contexto.SaveChanges();
     }
 }
예제 #2
0
 public void Atualiza(ComunicadoAluno ComunicadoAluno)
 {
     using (var contexto = new SalaContext())
     {
         contexto.Entry(ComunicadoAluno).State = EntityState.Modified;
         contexto.SaveChanges();
     }
 }
예제 #3
0
 public static void RemoveSala(int idSala)
 {
     using (var contexto = new SalaContext())
     {
         contexto.RemoveRange(from a in contexto.ComunicadoAluno
                              join c in contexto.Comunicado on a.CodComunicado equals c.Id
                              where c.CodSala == idSala
                              select a
                              );
         contexto.SaveChanges();
     }
 }