I am new to LINQ and I have managed to write some basic queries. But now I have somewhat complex requirement and I spend lot of time on it but couldnt solve myself.. Please help
I have 5 tables - The tablke names and fields are given below
1. Category [CID(pk), Name]
2. QuestionCategory [CID(fk), QID(fk)]
3. Questions [QID(pk), Question, UID(fk)]
4. Choices [ChID(pk), QID(fk), Choice]
5. Users [UID(pk), Name]
6. UserFavourites [UID(fk), QID(fk)]
I have 6 tables in my QuestionBank DB. Now I want to query the Questions and its details according to a CategoryID
The result should contain following
1. All the details about the question
2. All the choices under the question (using the UID fk in Choices table)
3. The details of the user who added the question (using the UID fk in Question table)
4. Whether the current logged in user added this Question to his favourite list. (using the UID fk and QID fk of UserFavourites table). The logged in users ID will be available in a variable.