I’m working on MVC3 and currently creating a Forum application in asp.net.
Forum allows the users to ask Question and also allows to add comment to the already asked questions…
Currently i need to display the question and comments on click of “details” View but don’t know how…:(
I have two tables: Question n Answer where Answer contains a foreign key of Question
how can I access multiple rows of Answer table for a single Question
Thank you!!
If you’re doing raw SQL here you go.
For EF, simply pull up the question object from context and then iterate over the Answers collection of the Auestion object.