Questions with multiple answers from different users

Hi Guys,

So I currently have an assignment with questions and answers. I can submit and update the answers perfectly. What I want to do is display questions but filter the answers by UserId. This is challenging because I'm using a list record to show the question with answers but the challenge now is only displaying answers specific to a user in the same list record. I'm lost. Any help would be greatly appreciated!

Kind Regards 

Werner


Hard to answer fully without knowing what your data model looks like.

But in general, what you need to do is in your Aggregate, join to the Users table and filter by UserId.

Assuming that questions and answers are in separate entities, you would also have a join between the questions and answers entities in your Aggregate. So for example, the original Aggregate would be something like GetQuestions, and you'd add a join to the Answers entity (with or without Answers, if you want all Questions), and then you'd add a join to the Users entity, and only get Answers with the filtered UserId (Answers.UserId = UserId).

The above is me thinking out the relationships as I might design them. Again, without specifics on your data model, it might be very different in your case.