Example #1
0
 public static ProfessorViewModel Professor(Professor professor)
 {
     return new ProfessorViewModel()
     {
         ProfessorID = professor.ProfessorID,
         Nome = professor.Nome
     };
 }
 public void Atualizar(Professor professor)
 {
     _contexto.Entry(professor).State = System.Data.Entity.EntityState.Modified;
     _contexto.SaveChanges();
 }
 public void Excluir(Professor professor)
 {
     _contexto.Entry(professor).State = System.Data.Entity.EntityState.Deleted;
     _contexto.SaveChanges();
 }
 public void Adicionar(Professor professor)
 {
     _contexto.Professores.Add(professor);
     _contexto.SaveChanges();
 }