public async Task <IActionResult> DeleteAluno(int id) { var aluno = await _context.Aluno .FirstOrDefaultAsync(m => m.IdAluno == id); if (aluno == null) { return(NotFound()); } _context.Aluno.Remove(aluno); await _context.SaveChangesAsync(); return(NoContent()); }
public async Task <IActionResult> Create([Bind("IdProfessor,Nome,DataUltimaImportacao")] Professor professor) { if (ModelState.IsValid) { _context.Add(professor); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(professor)); }