public List <List <ViewPlaylist> > GetViewPlaylist(GetPlaylistVideoModel getModel)
        {
            var playlist = _context.usp_GetPlaylistVideo
                           .FromSql(SP_GetAllPlayListVideo, new SqlParameter("playlistTypeId", getModel.playlistType))
                           .Skip(getModel.pageNumber * 12)
                           .Take(12)
                           .ToList();

            if (playlist != null && playlist.Count > 0)
            {
                var playlistVideos = _iMapper.Map <List <ViewPlaylist> >(playlist);
                return(splitList(playlistVideos));
            }

            return(null);
        }
Example #2
0
        public ActionResult GetViewPlaylist()
        {
            try
            {
                var playlistModel = Request.Form["playlistVideoModel"];
                GetPlaylistVideoModel getModel = JsonConvert.DeserializeObject <GetPlaylistVideoModel>(playlistModel);
                if (getModel == null)
                {
                    ModelState.AddModelError("error", "Playlist Video model does not exist.");
                    return(BadRequest(ModelState));
                }


                var response = _iPlaylistVideoService.GetViewPlaylist(getModel);
                return(Ok(response));
            }
            catch (Exception ex)
            {
                _iLogger.LogCritical($"Exception while deleting a user", ex);
                return(StatusCode(500, "A problem happened while handling your request"));
            }
        }
 public List <List <ViewPlaylist> > GetViewPlaylist(GetPlaylistVideoModel getModel)
 {
     return(this._playlistVideoRepository.GetViewPlaylist(getModel));
 }