コード例 #1
0
        public IActionResult Create(string account, [FromBody] ChannelSettings channelSettings)
        {
            if (channelSettings == null)
            {
                return(BadRequest());
            }

            var mediaServices  = App.Config.GetMediaServicesAccount(account);
            var context        = mediaServices.GetContext();
            var channelOptions = channelSettings.GetChannelCreationOptions();
            var operation      = context.Channels.SendCreateOperation(channelOptions);

            return(Ok(operation));
        }
        public IOperation Create(string account, [FromBody] ChannelSettings channelSettings)
        {
            if (channelSettings == null)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            var mediaServices  = App.Config.GetMediaServicesAccount(account);
            var context        = mediaServices.GetContext();
            var channelOptions = channelSettings.GetChannelCreationOptions();
            var operation      = context.Channels.SendCreateOperation(channelOptions);

            return(operation);
        }