public async Task <JsonResult> ProfessorExiste(string nome, int professorId) { if (professorId == 0) { if (await _professorRepositorio.ProfessorExiste(nome)) { return(Json("Professor já existe")); } return(Json(true)); } else { if (await _professorRepositorio.ProfessorExiste(nome, professorId)) { return(Json("Professor já existe")); } return(Json(true)); } }
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)); } }