Exemplo n.º 1
0
        public IDataResult <Channel> GetById(int id)
        {
            var channel = _channelDal.Get(c => c.Id == id);

            if (channel != null)
            {
                return(new SuccessDataResult <Channel>(channel));
            }
            return(new ErrorDataResult <Channel>(Messages.ChannelNotFound));
        }
Exemplo n.º 2
0
        public IDataResult <Channel> GetById(int id)
        {
            IResult result = BusinessRule.Run
                             (
                CheckIfChannelExist(id),
                CheckIfChannelPhotoEmpty(_channelDal.Get(channel => channel.Id == id), _path)
                             );

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

            return(new SuccessDataResult <Channel>(CheckIfChannelPhotoEmpty(_channelDal.Get(c => c.Id == id), _path).Data));
        }
Exemplo n.º 3
0
 public Channel GetById(Guid channelId)
 {
     return(_channelDal.Get(c => c.Id == channelId));
 }