Exemple #1
0
 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));
     }
 }
Exemple #2
0
 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));
     }
 }