Skip to content

Conversation

@MichalYiloz
Copy link
Member

@MichalYiloz MichalYiloz commented Jan 29, 2025

I added a function in the DAL called GetListCommentByIdDiscussionAsync
which returns a list of Comment by Discussion Id.
The function call is:
http://localhost:5131/api/Discussion/allComment/{Id}
my issues: #21
thanks!

Copy link
Member

@DvoraShechter1 DvoraShechter1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Please pay attention to the minor note below

else
{
List<Comment> comments = new List<Comment>();
foreach (var item in discussion.Comments)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a lambda expression:
return discussion.Comments.Where(item => item.DiscussionId == Id).ToList();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants