2
I am making a query using Inner Join of some tables and a Where with only one condition, but the data is not returned in EF,the same query in Mysql works and returns data.
Follows the code:
string raAluno = acr.getAlunoLogado().ToString();
var aluno = (from al in neEAD.mot_aluno
join ta in neEAD.mot_turmaaluno on al.al_id equals ta.ta_al_id
join tm in neEAD.mot_turma on ta.ta_tm_id equals tm.tm_id
join mo in neEAD.mot_modulo on tm.tm_mod_id equals mo.mod_id
join dp in neEAD.mot_disciplina on mo.mod_id equals dp.dp_mod_id
where (al.al_ra == "'" + raAluno + "'")
select new IndexModel
{
ID = al.al_id,
Nome = al.al_nome,
Disciplina = dp.dp_descricao,
IDDisciplina = dp.dp_id,
}).ToString();
return View(aluno);
Can anyone help me with this, because I can’t see the sql query to check if it is correct.
I switched to . Tolist() and removed from Where the single and double quotes, so it worked correctly.
– Deivid Farias