public IActionResult Update(Guid id, ChannelUpdateDto channelUpdateDto)
        {
            var result = _channelService.Update(id, channelUpdateDto);

            return(result.Success
                ? Ok(result.Message)
                : BadRequest(result.Message));
        }
Пример #2
0
        public IResult Update(Guid id, ChannelUpdateDto channelUpdateDto)
        {
            var channel = GetById(id);

            if (channel == null)
            {
                return(new ErrorResult("Channel cannot found!"));
            }

            channel.Name      = channelUpdateDto.Name;
            channel.Slug      = channelUpdateDto.Slug;
            channel.ImagePath = channelUpdateDto.ImagePath;

            return(_channelDal.Update(channel)
                ? new SuccessResult("Channel updated.")
                : new ErrorResult("Channel cannot updated!"));
        }