示例#1
0
 public IActionResult Get()
 {
     try
     {
         PlaylistModel playlistModel = _playlistRepository.GetModel(_settings.Value.PlaylistPath);
         IEnumerable <SongViewModel> songViewModels = playlistModel.Songs.Select(t =>
         {
             var res = new SongViewModel();
             res.MapFromModel(t);
             return(res);
         });
         return(new OkObjectResult(songViewModels));
     }
     catch (FileNotFoundException e)
     {
         return(new NotFoundResult());
     }
 }