sorry for my english, I'll try to be short and concise.
I have to tables "ALUMNOS" and "MATERIAS". In SQL exist another table "ALUMNOS BY MATERIAS". I know this is not necessary in EF because exists the properties navigation, but I need to get the ALUMNOS that were not enrolled in any MATERIAS.
I want something like that:
SELECT *
FROM ALUMNOS AS A
WHERE NOT EXISTS(
SELECT MA.MATERIAID
FROM MATERIASXALUMNO AS MA
WHERE A.LEGAJO = MA.LEGAJO
AND .MATERIAID = XXX)
But my confusion starts because in ALUMNOS entities I have Collection of Materias and vice versa, but I haven't in Alumnos MateriaID or in Materias AlumnosID so how can I do this with linq??
To summarize, what I need is get the Alumnos that aren't enrolled in an XX Materia and the Alumnos that they are enrolled in that Materia...
thanks in advance, I hope can help me, I fix it using Stored Procedures, but I want it with Linq or at least understand how is it doing...
Regards from Argentina! Guille