Exemple #1
0
 public HttpResponseMessage GetPlaylists([FromUri] int id)
 {
     using (var db = new OnlineMusicEntities())
     {
         var query = playlistDto.GetPlaylistQuery(db, playlist => playlist.UserId == id);
         var list  = (from pl in query select pl).ToList();
         return(Request.CreateResponse(HttpStatusCode.OK, list));
     }
 }
Exemple #2
0
 public HttpResponseMessage GetAllPlaylists()
 {
     using (var db = new OnlineMusicEntities())
     {
         var query         = dto.GetPlaylistQuery(db);
         var listPlaylists = query.OrderByDescending(pl => pl.Id).ToList();
         return(Request.CreateResponse(HttpStatusCode.OK, listPlaylists));
     }
 }