public static Playlist ToPlaylistModel(PlaylistViewModel playlist) { Mapper.CreateMap<PlaylistViewModel, Playlist>(); return Mapper.Map<PlaylistViewModel, Playlist>(playlist); }
public JsonResult GetPlaylistSongs(PlaylistViewModel playListModel) { var userId = User.Identity.GetUserId(); return Json(_playlistService.GetSongs(userId, playListModel.PlaylistId)); }
public JsonResult RemovePlaylist(PlaylistViewModel playListModel) { var userId = User.Identity.GetUserId(); _playlistService.RemovePlaylist(userId, playListModel.PlaylistId); return Json(null); }
public void AddPlayList(string userId, PlaylistViewModel playListModel) { _playlistRepository.AddPlayList(userId, ModelConverters.ToPlaylistModel(playListModel)); }