public IActionResult GetVideoPost(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var videoPost = _vpRepository.GetSingle(c => c.VideoPostId == id);

            if (videoPost != null)
            {
                var videoPostVM = Mapper.Map <VideoPost, VideoPostVM>(videoPost);

                return(new OkObjectResult(videoPostVM));
            }
            else
            {
                return(NotFound());
            }
        }
Beispiel #2
0
        public IActionResult GetSalaryInfo(int videoPostId)
        {
            if (videoPostId <= 0)
            {
                return(NotFound());
            }

            var videoPost = _vpRepository.GetSingle(vp => vp.VideoPostId == videoPostId, vp => vp.SalaryInfo);

            if (videoPost == null)
            {
                return(NotFound());
            }

            var salaryInfoVM = Mapper.Map <SalaryInfo, SalaryInfoVM>(videoPost.SalaryInfo);

            return(new OkObjectResult(salaryInfoVM));
        }