public HttpResponseMessage GetCommentsOfPlaylist([FromUri] int id) { using (var db = new OnlineMusicEntities()) { var listComments = commentDto.GetCommentQuery(db, (PlaylistComment c) => c.PlaylistId == id).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, listComments)); } }
public HttpResponseMessage GetCommentsOfAlbum([FromUri] int id) { using (var db = new OnlineMusicEntities()) { var listComments = commentDto.GetCommentQuery(db, (AlbumComment c) => c.AlbumId == id) .OrderByDescending(c => c.Date).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, listComments)); } }