public IActionResult ChangeStatus(string channelId, bool?isDisable) { BaseResponseDto responseDto = null; if (channelId == null) { return(BadRequest("Channel Id must not be null.")); } if (isDisable.Equals(null)) { return(BadRequest("Must specify isDisable parameter in order to allow this function works correctly")); } bool disable = isDisable.Value; try { responseDto = _channel.ChangeStatus(channelId, disable); } catch (Exception e) { return(StatusCode(500, e)); } if (responseDto.Status == 1 || responseDto.Status == 2) { return(BadRequest(responseDto.Message)); } return(disable ? Ok("Channel is disabled.") : Ok("Channel is enabled.")); }