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)); }
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)); }
public Channel GetById(Guid channelId) { return(_channelDal.Get(c => c.Id == channelId)); }