public IHttpActionResult PostChannel(ChannelInputModel channelData)
        {
            if (channelData == null)
            {
                return this.BadRequest();
            }
            if (this.db.Channels.Any(c=> c.Name == channelData.Name))
            {
                return this.Conflict();
            }
            
            if (!this.ModelState.IsValid)
            {
                return this.BadRequest(this.ModelState);
            }
            var channel = new Channel(){Name = channelData.Name};


            this.db.Channels.Add(channel);
            this.db.SaveChanges();

            var createdCHannelOutput = new ChannelOutputModel()
                {
                    Id = channel.Id,
                    Name = channel.Name
                };

            return this.CreatedAtRoute("DefaultApi", new { id = channel.Id }, createdCHannelOutput);
        }
        public IHttpActionResult PutChannel(int id, ChannelInputModel channelData)
        {
            if (channelData == null)
            {
                return this.BadRequest("Invalid channel data");
            }
            if (!this.ModelState.IsValid)
            {
                return this.BadRequest(this.ModelState);
            }

            Channel channel = this.db.Channels.Find(id);
            if (channel == null)
            {
                return this.NotFound();
            }

            var duplicateChannel = db.Channels.Any(c => c.Name == channelData.Name);

            if (duplicateChannel)
            {
                return this.Conflict();
            }
            channel.Name = channelData.Name;
            this.db.SaveChanges();

            return this.Ok(new
                {
                    Message = "Channel #" + channel.Id + " edited successfully"
                });
        }