Пример #1
0
        public IDataResult <Video> GetById(int id)
        {
            var     getToVideo = _videoDal.Get(v => v.Id == id);
            IResult result     = BusinessRule.Run
                                 (
                CheckIfVideoExist(id),
                _userService.CheckIfUserExist(getToVideo.UserId),
                _channelService.CheckIfChannelExist(getToVideo.ChannelId)
                                 );

            if (result != null)
            {
                return(new ErrorDataResult <Video>(result.Message));
            }

            return(new SuccessDataResult <Video>(getToVideo));
        }
Пример #2
0
 public Video GetById(int id)
 {
     return(_videoDal.Get(v => v.VideoID == id));
 }