I have three tables. Question, Discipline and QuestionHasDiscipline. QuestionHasDiscipline holds the relation between Question and Discipline. They all have an unique id-column to identify them.
I am trying to write a linq-statement that returns all the questions that have a certain discipline.
What I have begun doing is this:
var questions = (from q in context.Questions
where (from d in context.QuestionHasDiscipline
where d.QuestionId == q.QuestionId
) ...
But it obviously is horribly wrong. I’ve tried different approaches but now I turn to the greater minds.. Any suggestions?
You can use
.Any()with a predicate.