public async Task <JsonResult> ProfessorExiste(string Nome, int ProfessorId) { if (ProfessorId == 0) { if (await _repositorio.VerificaProfessorPeloNome(Nome)) { return(Json("Professor já existe")); } return(Json(true)); } else { if (await _repositorio.ProfessorExiste(Nome, ProfessorId)) { return(Json("Professor já existe")); } return(Json(true)); } }