コード例 #1
0
 public static Playlist ToPlaylistModel(PlaylistViewModel playlist)
 {
     Mapper.CreateMap<PlaylistViewModel, Playlist>();
     return Mapper.Map<PlaylistViewModel, Playlist>(playlist);
 }
コード例 #2
0
 public JsonResult GetPlaylistSongs(PlaylistViewModel playListModel)
 {
     var userId = User.Identity.GetUserId();
     return Json(_playlistService.GetSongs(userId, playListModel.PlaylistId));
 }
コード例 #3
0
 public JsonResult RemovePlaylist(PlaylistViewModel playListModel)
 {
     var userId = User.Identity.GetUserId();
     _playlistService.RemovePlaylist(userId, playListModel.PlaylistId);
     return Json(null);
 }
コード例 #4
0
 public void AddPlayList(string userId, PlaylistViewModel playListModel)
 {
     _playlistRepository.AddPlayList(userId, ModelConverters.ToPlaylistModel(playListModel));
 }